:root{
  --primary:#4f46e5; --primary-2:#7c3aed; --primary-dark:#4338ca;
  --bg:#f4f5fb; --card:#ffffff; --text:#1e1b2e; --muted:#6b7280;
  --success:#10b981; --danger:#ef4444; --radius:20px;
  --shadow:0 10px 30px rgba(79,70,229,.10);
}
*{-webkit-tap-highlight-color:transparent}
body{font-family:'Inter',system-ui,sans-serif;background:var(--bg);color:var(--text);padding-bottom:76px}
@media(min-width:768px){body{padding-bottom:0}}

.container-xl{max-width:960px}
.section{padding:48px 0 24px}

/* Шапка */
.site-header{position:sticky;top:0;z-index:100;background:rgba(255,255,255,.85);backdrop-filter:blur(12px);border-bottom:1px solid rgba(30,27,46,.06)}
.header-inner{max-width:960px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;padding:8px 16px}
.brand{display:flex;align-items:center;gap:14px;text-decoration:none;color:var(--text)}
.brand-avatar{width:92px;height:92px;border-radius:50%;object-fit:cover;border:3px solid #fff;box-shadow:0 4px 16px rgba(79,70,229,.25)}
.brand-text{display:flex;flex-direction:column;line-height:1.2}
.brand-name{font-weight:800;font-size:1.5rem}
.brand-name b{color:var(--primary)}
.brand-sub{font-size:.92rem;color:var(--muted);font-weight:500}
.header-actions{display:flex;align-items:center;gap:8px}
.btn-sub{border:1.5px solid var(--primary);color:var(--primary);background:#fff;border-radius:99px;padding:8px 18px;font-weight:600;font-size:.9rem}
.btn-sub:hover{background:var(--primary);color:#fff}
.btn-login{background:var(--primary);color:#fff;border:none;border-radius:99px;padding:8px 20px;font-weight:600;font-size:.9rem}
.btn-login:hover{background:var(--primary-dark)}
@media(max-width:575px){.brand-avatar{width:64px;height:64px}.brand-name{font-size:1.15rem}.brand-sub{font-size:.78rem}}

/* Кнопки */
.btn{border-radius:14px;font-weight:600}
.btn-primary{background:linear-gradient(135deg,var(--primary),var(--primary-2));border:none;box-shadow:0 6px 18px rgba(79,70,229,.35)}
.btn-primary:hover{filter:brightness(1.06)}
.btn-outline{border:1.5px solid #d7d9e6;background:#fff;color:var(--text)}
.btn-outline:hover{border-color:var(--primary);color:var(--primary)}
.btn-ghost{border:none;background:#f0f1f7;color:var(--text);border-radius:14px}

/* Герой */
.hero{padding:36px 0 8px}
.hero-grid{display:grid;gap:26px;grid-template-columns:1fr}
@media(min-width:992px){.hero-grid{grid-template-columns:1.05fr .95fr;align-items:start}}
.hero-pill{display:inline-block;background:#eef2ff;color:var(--primary);font-size:clamp(1.05rem,2.6vw,1.55rem);font-weight:700;padding:10px 22px;border-radius:99px;margin-bottom:16px}
.hero-title{font-weight:800;font-size:clamp(1.7rem,5vw,2.6rem);line-height:1.15;margin-bottom:14px}
.grad{background:linear-gradient(135deg,var(--primary),var(--primary-2));-webkit-background-clip:text;background-clip:text;color:transparent}
.hero-sub{color:#34324a;font-size:1.14rem;font-weight:500;line-height:1.6;max-width:540px}
.check-list{list-style:none;padding:0;margin:14px 0 0;color:#2c2a3e;font-size:1.06rem;font-weight:500;line-height:2}
@media(min-width:992px){.check-list{font-size:1.12rem}}

/* Карточка загрузки */
.upload-card{background:var(--card);border-radius:var(--radius);padding:22px;box-shadow:var(--shadow)}
.upload-icon{width:64px;height:64px;border-radius:18px;background:#eef2ff;color:var(--primary);display:flex;align-items:center;justify-content:center;margin:6px auto 14px}
.upload-title{font-weight:600;margin-bottom:2px;text-align:center}
.upload-hint{color:var(--muted);font-size:.85rem;text-align:center;margin-bottom:16px}
.upload-btn{position:relative;overflow:hidden}
.upload-btn input{position:absolute;inset:0;opacity:0;cursor:pointer}
.preview-img{width:100%;max-height:260px;object-fit:cover;border-radius:14px}
.free-note{text-align:center;font-size:.8rem;color:var(--muted);margin-top:14px}
.free-note b{color:var(--primary)}

/* Прогресс */
.progress-card{background:var(--card);border-radius:var(--radius);padding:20px 22px;box-shadow:var(--shadow);margin-top:26px}
.progress-pct{font-weight:700;color:var(--primary)}
.progress-track{height:8px;background:#eceef8;border-radius:99px;overflow:hidden}
.progress-fill{height:100%;width:0;background:linear-gradient(90deg,var(--primary),var(--primary-2));border-radius:99px;transition:width .4s}

/* Результат */
.result-card{background:var(--card);border-radius:var(--radius);padding:22px;box-shadow:var(--shadow);margin-top:26px}
.result-grid{display:grid;gap:18px;grid-template-columns:1fr}
@media(min-width:768px){.result-grid{grid-template-columns:1fr 1fr;align-items:start}}
.result-photo{width:100%;border-radius:16px;box-shadow:0 8px 24px rgba(0,0,0,.12)}
.result-head{display:flex;align-items:center;gap:8px;color:var(--success);font-weight:600;font-size:.85rem;margin-bottom:8px}
.status-dot{width:8px;height:8px;border-radius:50%;background:var(--success);animation:pulse 1.5s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}
.result-title{font-weight:800;margin-bottom:12px}
.file-row{display:flex;align-items:center;gap:10px;background:#f6f7fc;padding:12px 14px;border-radius:12px;margin-bottom:8px}
.file-size{margin-left:auto;color:var(--muted);font-size:.8rem}
.result-hint{color:var(--muted);font-size:.82rem}

/* Заголовки секций */
.section-title{font-weight:800;font-size:clamp(1.3rem,3.5vw,1.8rem)}
.section-sub{color:var(--muted);font-size:.95rem}
.models-count{font-size:.85rem;color:var(--muted);font-weight:500}

/* Мои модели — лента */
.models-ribbon{display:flex;gap:14px;overflow-x:auto;padding:6px 4px 18px;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch}
.models-ribbon::-webkit-scrollbar{height:6px}
.models-ribbon::-webkit-scrollbar-thumb{background:#d5d7ea;border-radius:99px}
.model-card{flex:0 0 230px;scroll-snap-align:start;background:var(--card);border-radius:var(--radius);padding:14px;box-shadow:var(--shadow)}
.model-card img{width:100%;height:190px;object-fit:contain;border-radius:12px;background:#fff}
.model-date{font-size:.75rem;color:var(--muted);margin:8px 0}
.model-card .btn{font-size:.82rem;padding:8px 10px}

/* Магазин */
.shop-grid{display:grid;gap:16px;grid-template-columns:repeat(2,1fr)}
@media(min-width:768px){.shop-grid{grid-template-columns:repeat(3,1fr)}}
@media(min-width:1100px){.shop-grid{grid-template-columns:repeat(4,1fr)}}
.shop-card{background:var(--card);border-radius:var(--radius);padding:14px;box-shadow:var(--shadow);display:flex;flex-direction:column}
.shop-card img{width:100%;height:190px;object-fit:contain;border-radius:12px;cursor:pointer;background:#fff}
.shop-name{font-weight:700;margin:10px 0 2px;font-size:.95rem}
.shop-price{font-weight:800;color:var(--primary);margin-bottom:10px}
.shop-card .btn{font-size:.85rem;padding:8px 12px;margin-top:auto}

/* Футер */
.site-footer{background:#191627;color:#b9b6cc;padding:36px 0 20px;margin-top:40px}
.footer-grid{display:grid;gap:24px;grid-template-columns:1fr}
@media(min-width:768px){.footer-grid{grid-template-columns:1fr 1fr 1fr}}
.footer-text,.footer-rekv{font-size:.85rem;line-height:1.7}
.footer-rekv a,.footer-links a{color:#c9c6de;text-decoration:none}
.footer-rekv a:hover,.footer-links a:hover{color:#fff}
.footer-links a{display:block;margin-bottom:6px;font-size:.9rem}
.site-footer .brand-name{color:#fff}
.site-footer .brand-name b{color:#a5b4fc}
.footer-copy{font-size:.75rem;color:#7a7794;margin-top:24px;border-top:1px solid rgba(255,255,255,.08);padding-top:16px}

/* Нижняя навигация */
.bottom-nav{position:fixed;bottom:0;left:0;right:0;background:rgba(255,255,255,.95);backdrop-filter:blur(12px);border-top:1px solid rgba(0,0,0,.06);display:flex;z-index:100;padding:6px 0 8px}
.nav-item{flex:1;background:none;border:none;display:flex;flex-direction:column;align-items:center;gap:2px;color:var(--muted);font-size:.68rem;font-weight:600}
.nav-item.active{color:var(--primary)}
.nav-item svg{width:22px;height:22px}

/* Модалки */
.pay-modal{border-radius:22px;border:none}
.pay-sum-row{display:flex;justify-content:space-between;background:#f6f7fc;padding:14px 16px;border-radius:12px;font-size:1.05rem}
.offer-text{font-size:.9rem;color:#3a3748;line-height:1.7}
.offer-text p{margin-bottom:12px}

/* Toast */
.toast-wrap{position:fixed;top:110px;left:50%;transform:translateX(-50%);z-index:2000;display:flex;flex-direction:column;gap:8px;width:calc(100% - 32px);max-width:420px}
.toast-msg{background:#1e1b2e;color:#fff;padding:12px 18px;border-radius:14px;font-size:.88rem;box-shadow:0 10px 30px rgba(0,0,0,.25);animation:slideDown .3s}
.toast-msg.err{background:var(--danger)}
@keyframes slideDown{from{opacity:0;transform:translateY(-12px)}to{opacity:1;transform:translateY(0)}}

/* Баннер маркетплейса в шапке */
.market-banner{display:flex;align-items:center;gap:9px;margin-left:12px;padding:4px 14px 4px 4px;
  border-radius:99px;background:linear-gradient(135deg,#eef2ff,#f7f0ff);
  border:1.5px solid rgba(79,70,229,.25);text-decoration:none;flex-shrink:0;
  transition:box-shadow .2s}
.market-banner:hover{box-shadow:0 5px 16px rgba(79,70,229,.25)}
.market-banner img{width:38px;height:38px;border-radius:12px;object-fit:contain;
  background:#fff;border:1.5px solid rgba(79,70,229,.15)}
.market-banner .mb-text{display:flex;flex-direction:column;line-height:1.2}
.market-banner .mb-title{font-weight:700;font-size:.8rem;color:var(--primary-dark)}
.market-banner .mb-cta{font-size:.68rem;font-weight:600;color:var(--primary)}
/* Заглушка, пока рендер превью не готов */
.preview-empty{display:flex;align-items:center;justify-content:center;height:120px;border-radius:14px;background:#f0f1f7;color:#6b7280;font-size:.85rem;font-weight:500}

/* Бейдж «Улучшена» и заглушка превью */
.badge-improved{display:inline-flex;align-items:center;justify-content:center;flex:1;border-radius:14px;padding:10px 14px;font-weight:600;color:#0b7a55;background:#e7f8f1;border:1.5px solid #bfe8d6;font-size:.95rem}
.preview-ph{display:flex;align-items:center;justify-content:center;height:150px;border-radius:14px;background:#eef0f8;color:var(--muted);font-size:.9rem;margin-bottom:6px}

@media (max-width: 767px) {
  .header-inner {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .market-banner {
    order: 2;
    width: 100%;
    justify-content: center;
    margin-left: 0 !important;
  }
  .header-actions {
    order: 3;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
  }
  .brand-sub {
    display: none;
  }
}

@media (max-width: 767px) {
  .hero,
  .section {
    padding-left: 20px;
    padding-right: 20px;
  }
}
