/* ============================================================
   Component styles — landing, auth, studio
   ============================================================ */

/* ===== shared pills / segmented / toggle ===== */
.pill {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 7px;
  letter-spacing: .02em; white-space: nowrap;
}
.pill-free { background: rgba(34,211,238,.14); color: #67e8f9; border: 1px solid rgba(34,211,238,.3); }
.pill-pro  { background: rgba(139,92,246,.16); color: #c4b5fd; border: 1px solid rgba(139,92,246,.36); }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-btn {
  padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  transition: all .16s ease;
}
.seg-btn:hover { border-color: var(--border-strong); color: var(--text); }
.seg-btn.on { background: rgba(139,92,246,.16); border-color: rgba(139,92,246,.5); color: #fff; }

.toggle {
  display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600;
  padding: 10px 16px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text-muted); transition: all .16s;
}
.toggle.on { color: #fff; border-color: rgba(139,92,246,.4); background: rgba(139,92,246,.1); }
.toggle-sw {
  width: 34px; height: 20px; border-radius: 99px; background: rgba(255,255,255,.12);
  position: relative; transition: background .2s; flex-shrink: 0;
}
.toggle-sw::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .2s;
}
.toggle.on .toggle-sw { background: var(--purple); }
.toggle.on .toggle-sw::after { transform: translateX(14px); }

.hov-lift { transition: transform .2s cubic-bezier(.2,.7,.2,1), box-shadow .25s, border-color .2s; }
.hov-lift:hover { transform: translateY(-4px); box-shadow: 0 18px 50px -20px rgba(0,0,0,.7); border-color: var(--border-strong); }

.dia { font-weight: 700; white-space: nowrap; }
.link { color: #c4b5fd; font-weight: 600; cursor: pointer; background: none; }
.link:hover { color: #ddd6fe; text-decoration: underline; }

.spinner-sm { width: 17px; height: 17px; border-width: 2px; }

/* ===== logo ===== */
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -.02em; }
.logo-mark { font-size: 1.15em; }
.logo-text { background: linear-gradient(100deg,#fff,#c4b5fd); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.sec-head { margin-bottom: 44px; }
.sec-title { font-size: clamp(28px, 4vw, 44px); margin-top: 12px; }
.container-narrow { max-width: 820px; }
.sec-alt { background: linear-gradient(180deg, transparent, rgba(139,92,246,.04), transparent); }
.ta-r { text-align: right; }
.block-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }

/* ============================================================
   LANDING
   ============================================================ */
.lheader {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.lheader.on {
  background: rgba(10,10,15,.72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.lheader-in { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.lnav { display: flex; gap: 30px; }
.lnav a { font-size: 14.5px; font-weight: 500; color: var(--text-muted); transition: color .16s; }
.lnav a:hover { color: var(--text); }
.lheader-cta { display: flex; gap: 10px; }

.hero { padding: 168px 0 96px; text-align: center; position: relative; }
.hero-in { display: flex; flex-direction: column; align-items: center; }
.hero-h1 { font-size: clamp(40px, 7vw, 76px); margin: 26px 0 22px; max-width: 14ch; }
.hero-sub { font-size: clamp(17px, 2.4vw, 21px); color: var(--text-muted); max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 38px; flex-wrap: wrap; justify-content: center; }
.hero-strip { display: flex; gap: 10px; margin-top: 44px; flex-wrap: wrap; justify-content: center; }
.hero-chip {
  font-size: 13px; font-weight: 500; color: var(--text-muted); padding: 7px 14px;
  border-radius: 99px; background: var(--surface); border: 1px solid var(--border);
}

/* features */
.card-pow { padding: 30px; display: flex; flex-direction: column; }
.pow-title { font-size: 22px; font-weight: 700; margin: 20px 0 6px; }
.pow-head { font-size: 15px; font-weight: 600; color: #c4b5fd; margin-bottom: 10px; }
.pow-body { font-size: 14.5px; line-height: 1.55; flex: 1; }
.pow-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }

/* steps */
.steps { gap: 28px; }
.step { padding: 8px 4px; }
.step-n { font-size: 64px; font-weight: 900; line-height: 1; letter-spacing: -.04em; }
.step-t { font-size: 19px; font-weight: 700; margin: 16px 0 8px; }

/* tabs */
.tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 40px; flex-wrap: wrap; }
.tabs-left { justify-content: flex-start; margin-bottom: 28px; }
.tab {
  position: relative; padding: 12px 20px; font-size: 15px; font-weight: 600;
  color: var(--text-muted); transition: color .2s;
}
.tab.on { color: var(--text); }
.tab-underline {
  position: absolute; left: 16px; right: 16px; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--grad-accent); transform: scaleX(0); transition: transform .2s ease;
}
.tab.on .tab-underline { transform: scaleX(1); }
.tab-count { font-size: 12px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--text-muted); margin-left: 2px; }

/* model cards */
.grid-models { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.model-card { padding: 22px; display: flex; flex-direction: column; }
.model-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.model-emoji { font-size: 26px; }
.model-name { font-size: 17px; font-weight: 700; }
.model-note { font-size: 13px; margin-top: 5px; flex: 1; }
.model-price { font-size: 15px; font-weight: 700; color: #c4b5fd; margin-top: 16px; }
.model-meta { font-size: 13px; color: var(--text-muted); margin-top: 14px; font-weight: 500; }

/* video table */
.vid-table { padding: 8px 6px; }
.vid-row { display: grid; grid-template-columns: 1.4fr 1fr 1.3fr .8fr; gap: 12px; align-items: center; padding: 15px 18px; border-radius: 10px; }
.vid-row:not(.vid-head):hover { background: var(--surface); }
.vid-head { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); font-weight: 600; }
.vid-name { font-weight: 700; font-size: 15.5px; }
.vid-price { font-weight: 700; color: #c4b5fd; }
.vid-row:not(.vid-head) + .vid-row:not(.vid-head) { border-top: 1px solid rgba(255,255,255,.04); }

/* tools */
.tool-card { padding: 26px; display: flex; gap: 18px; align-items: flex-start; }
.tool-emoji { font-size: 32px; flex-shrink: 0; }
.tool-body { flex: 1; }
.tool-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 8px; }
.tool-head h4 { font-size: 17px; font-weight: 700; }
.tool-price { padding: 4px 10px; font-size: 12px; }

/* pricing */
.plans { align-items: stretch; }
.plan { padding: 32px 28px; display: flex; flex-direction: column; position: relative; }
.plan-hot { border-color: rgba(139,92,246,.5); box-shadow: 0 0 0 1px rgba(139,92,246,.3), 0 24px 70px -30px rgba(139,92,246,.6); }
.plan-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--grad-accent); color: #fff; font-size: 12px; font-weight: 700;
  padding: 5px 16px; border-radius: 99px; white-space: nowrap;
}
.plan-name { font-size: 21px; font-weight: 800; }
.plan-price { display: flex; align-items: baseline; gap: 5px; margin: 14px 0 22px; }
.plan-amt { font-size: 38px; font-weight: 800; letter-spacing: -.03em; }
.plan-feats { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; flex: 1; }
.plan-feats li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; }
.check { color: #34d399; font-weight: 800; flex-shrink: 0; }
.pricing-note { text-align: center; margin-top: 30px; font-size: 14px; }

/* faq */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; transition: border-color .2s; }
.faq-item.open { border-color: rgba(139,92,246,.4); }
.faq-q { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 20px 24px; font-size: 16.5px; font-weight: 600; text-align: left; }
.faq-ic { font-size: 22px; color: var(--purple); flex-shrink: 0; width: 24px; text-align: center; }
.faq-a-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease; }
.faq-item.open .faq-a-wrap { grid-template-rows: 1fr; }
.faq-a { overflow: hidden; padding: 0 24px; font-size: 15px; line-height: 1.6; }
.faq-item.open .faq-a { padding: 0 24px 22px; }

/* cta */
.cta-card { padding: 2px; border-radius: 28px; background: var(--grad-accent); }
.cta-inner { border-radius: 26px; padding: 64px 32px; text-align: center; background: #0c0c14; }
.cta-title { font-size: clamp(28px, 4vw, 42px); }
.cta-sub { font-size: 17px; margin: 14px 0 32px; }

/* footer */
.lfooter { border-top: 1px solid var(--border); padding: 64px 0 40px; margin-top: 40px; }
.lfooter-in { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.lfooter-brand { max-width: 280px; }
.lfooter-brand p { margin-top: 14px; font-size: 14px; }
.lfooter-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.lfooter-col { display: flex; flex-direction: column; gap: 12px; }
.lfooter-col h5 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); font-weight: 700; margin-bottom: 4px; }
.lfooter-link { font-size: 14.5px; color: var(--text-muted); text-align: left; transition: color .16s; }
.lfooter-link:hover { color: var(--text); }
.lfooter-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 13.5px; }

/* ============================================================
   AUTH
   ============================================================ */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 80px 20px; position: relative; }
.auth-back { position: fixed; top: 24px; left: 24px; font-size: 14px; color: var(--text-muted); font-weight: 500; z-index: 5; }
.auth-back:hover { color: var(--text); }
.auth-card { width: 100%; max-width: 440px; padding: 40px 36px 32px; position: relative; overflow: hidden; }
.auth-card-top { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grad-accent); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 4px 0 20px; color: var(--text-muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.09); }
.auth-divider span { white-space: nowrap; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 26px; }
.auth-title { font-size: 28px; text-align: center; }
.auth-sub { text-align: center; margin: 8px 0 28px; font-size: 15px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.field-input {
  background: rgba(0,0,0,.25); border: 1px solid var(--border); border-radius: 11px;
  padding: 13px 15px; font-size: 15px; color: var(--text); transition: border-color .16s, box-shadow .16s;
  width: 100%;
}
.field-input::placeholder { color: var(--text-dim); }
.field-input:focus { outline: none; border-color: rgba(139,92,246,.6); box-shadow: 0 0 0 3px rgba(139,92,246,.16); }
.auth-err { font-size: 13.5px; color: #fca5a5; background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.25); padding: 10px 14px; border-radius: 10px; }
.auth-footer { text-align: center; margin-top: 22px; font-size: 14px; }
.auth-hint { text-align: center; margin-top: 16px; font-size: 12.5px; }
.btn[disabled] { opacity: .7; cursor: default; }

/* ============================================================
   STUDIO
   ============================================================ */
.studio { min-height: 100vh; display: flex; background: var(--bg); }
.sidebar {
  width: 240px; flex-shrink: 0; position: fixed; top: 0; bottom: 0; left: 0;
  border-right: 1px solid var(--border); background: var(--bg-2);
  display: flex; flex-direction: column; padding: 22px 16px; z-index: 30;
}
.sidebar-logo { padding: 6px 8px 22px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.snav {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px;
  font-size: 14.5px; font-weight: 600; color: var(--text-muted); text-align: left;
  transition: background .16s, color .16s;
}
.snav:hover { background: var(--surface); color: var(--text); }
.snav.on { background: rgba(139,92,246,.14); color: #fff; }
.snav-ic { font-size: 17px; width: 22px; text-align: center; }
.sidebar-foot { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.balance-chip {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 11px 14px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border);
  font-size: 14px; transition: border-color .16s;
}
.balance-chip:hover { border-color: var(--border-strong); }
.balance-coins { font-size: 13px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 4px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-weight: 700; font-size: 16px; color: #fff; background: var(--grad-accent);
}
.avatar-lg { width: 64px; height: 64px; font-size: 26px; }
.sidebar-user-meta { flex: 1; min-width: 0; }
.su-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-email { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn { font-size: 18px; color: var(--text-muted); padding: 4px 8px; border-radius: 8px; }
.logout-btn:hover { background: var(--surface); color: #fca5a5; }

.studio-topbar { display: none; }
.studio-main { flex: 1; margin-left: 240px; min-width: 0; }
.studio-main-in { max-width: 1080px; margin: 0 auto; padding: 40px 40px 80px; }

.bottomnav { display: none; }

/* page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; }
.page-head-text { flex: 1 1 auto; min-width: 0; }
.page-title { font-size: 30px; }
.page-sub { font-size: 15px; margin-top: 7px; }

/* dashboard */
.dash-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; margin-bottom: 40px; }
.balance-card { padding: 28px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.balance-label { font-size: 13px; }
.balance-big { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1; white-space: nowrap; }
.balance-row { display: flex; align-items: center; gap: 14px; }
.quick-actions { display: flex; flex-direction: column; gap: 14px; }
.quick-act { display: flex; align-items: center; gap: 16px; padding: 20px 24px; text-align: left; }
.quick-ic { font-size: 26px; width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.qa-img .quick-ic { background: var(--grad-image); }
.qa-vid .quick-ic { background: var(--grad-video); }
.qa-mus .quick-ic { background: var(--grad-music); }
.quick-l { flex: 1; font-size: 16px; font-weight: 700; }
.quick-arr { font-size: 20px; color: var(--text-muted); }

.dash-recent-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.recent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.recent-card { padding: 12px; }
.recent-art { width: 100%; aspect-ratio: 16/10; margin-bottom: 12px; }
.recent-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.recent-badge { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-time { font-size: 12px; flex-shrink: 0; }
.recent-prompt { font-size: 13px; margin-top: 7px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== generation layout ===== */
.gen-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.gen-settings { display: flex; flex-direction: column; gap: 22px; }
.field-block { display: flex; flex-direction: column; gap: 11px; }
.block-label { font-size: 14px; font-weight: 700; }
.block-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prompt-area {
  background: rgba(0,0,0,.25); border: 1px solid var(--border); border-radius: 13px;
  padding: 14px 16px; font-size: 15px; color: var(--text); resize: vertical; line-height: 1.5; min-height: 90px;
}
.prompt-area::placeholder { color: var(--text-dim); }
.prompt-area:focus { outline: none; border-color: rgba(139,92,246,.5); box-shadow: 0 0 0 3px rgba(139,92,246,.14); }
.prompt-ideas { display: flex; flex-wrap: wrap; gap: 8px; }
.idea-chip { font-size: 12px; color: var(--text-muted); padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); transition: all .16s; }
.idea-chip:hover { color: var(--text); border-color: var(--border-strong); }
.enhance-btn { padding: 7px 13px; font-size: 13px; }

/* model picker */
.model-picker { display: flex; flex-direction: column; gap: 8px; }
.mp-btn { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); text-align: left; transition: all .16s; }
.mp-btn:hover { border-color: var(--border-strong); }
.mp-btn.on { border-color: rgba(139,92,246,.5); background: rgba(139,92,246,.1); }
.mp-emoji { font-size: 22px; width: 26px; text-align: center; flex-shrink: 0; }
.mp-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mp-name { font-size: 14.5px; font-weight: 700; }
.mp-note { font-size: 12.5px; }
.mp-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.mp-price { font-size: 13px; font-weight: 700; color: #c4b5fd; }

/* upload */
.upload {
  border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer;
  transition: border-color .16s, background .16s; background: rgba(0,0,0,.16);
}
.upload:hover, .upload.drag { border-color: rgba(139,92,246,.6); background: rgba(139,92,246,.06); }
.upload-ic { font-size: 26px; }
.upload-hint { font-size: 13.5px; }
.upload.has { padding: 14px 16px; border-style: solid; }
.upload-has { display: flex; align-items: center; gap: 10px; width: 100%; }
.upload-name { flex: 1; font-size: 13.5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-x { font-size: 13px; color: var(--text-muted); padding: 4px 8px; border-radius: 7px; }
.upload-x:hover { background: var(--surface-2); color: #fca5a5; }

/* result panel */
.gen-result { min-height: 440px; display: flex; align-items: center; justify-content: center; padding: 20px; position: sticky; top: 24px; }
.result-pad { align-items: stretch; }
.result-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 40px; width: 100%; }
.result-empty-ic { font-size: 46px; opacity: .5; }
.result-art { width: 100%; }
.result-loading { width: 100%; display: flex; flex-direction: column; gap: 18px; }
.loading-row { display: flex; align-items: center; gap: 14px; justify-content: center; }
.result-done { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.result-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.result-actions-btns { display: flex; gap: 8px; }
.result-info { display: flex; flex-direction: column; gap: 2px; }
.result-model { font-weight: 700; font-size: 15px; }
.result-prompt { font-size: 13.5px; line-height: 1.5; }

/* ===== video flow ===== */
.vsteps { display: flex; gap: 10px; margin-bottom: 30px; flex-wrap: wrap; }
.vstep { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: var(--text-dim); padding: 8px 0; }
.vstep-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--surface); border: 1px solid var(--border); }
.vstep.on { color: var(--text-muted); }
.vstep.on .vstep-n { background: rgba(139,92,246,.2); border-color: rgba(139,92,246,.5); color: #fff; }
.vstep.cur { color: #fff; }
.vstep.cur .vstep-n { background: var(--grad-accent); border-color: transparent; }
.vstep:not(:last-child)::after { content: '→'; margin-left: 8px; color: var(--text-dim); }

.vid-models { display: flex; flex-direction: column; gap: 12px; }
.vid-model { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; text-align: left; }
.vm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.vm-name { font-size: 17px; font-weight: 700; }
.vm-note { font-size: 13.5px; }
.vm-specs { display: flex; gap: 16px; margin-top: 10px; font-size: 12.5px; flex-wrap: wrap; }
.vm-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.vm-price { font-size: 17px; font-weight: 800; color: #c4b5fd; white-space: nowrap; }

.back-btn { align-self: flex-start; }
.selected-model { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.toggle-row { display: flex; gap: 10px; flex-wrap: wrap; }
.vsummary { margin-top: 26px; width: 100%; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.vsummary > div { display: flex; align-items: center; justify-content: space-between; font-size: 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.05); }
.vsummary > div:last-child { border-bottom: none; padding-bottom: 0; }
.vsummary-price { color: #c4b5fd; font-size: 17px; }

.render-box { display: flex; flex-direction: column; gap: 20px; }
.render-art { width: 100%; aspect-ratio: 16/9; }
.render-info { display: flex; flex-direction: column; gap: 10px; }
.render-model { font-weight: 700; font-size: 15px; }
.render-pct { font-size: 13px; }
.progress { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; background: var(--grad-accent); transition: width .5s ease; }

.video-player { position: relative; width: 100%; border-radius: var(--radius-sm); overflow: hidden; display: grid; place-items: center; background: #000; }
.play-btn { position: relative; z-index: 2; width: 66px; height: 66px; border-radius: 50%; background: rgba(255,255,255,.16); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.3); color: #fff; font-size: 22px; display: grid; place-items: center; padding-left: 4px; transition: transform .16s, background .16s; }
.play-btn:hover { transform: scale(1.08); background: rgba(255,255,255,.26); }

/* ===== music ===== */
.music-models { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.music-card { display: flex; align-items: center; gap: 14px; padding: 18px 20px; text-align: left; position: relative; }
.music-card.on { border-color: rgba(34,211,238,.5); background: rgba(34,211,238,.07); }
.music-card-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.music-name { font-size: 15.5px; font-weight: 700; }
.music-note { font-size: 12.5px; }
.music-check { position: absolute; top: 12px; right: 14px; color: #22d3ee; font-weight: 800; }
.coins-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.music-cover { width: 100%; aspect-ratio: 16/9; }
.music-loading { align-items: center; }
.eq { display: flex; align-items: flex-end; gap: 5px; height: 70px; }
.eq span { width: 7px; border-radius: 4px; background: var(--grad-music); animation: eqbounce 1s ease-in-out infinite; }
@keyframes eqbounce { 0%,100% { height: 16px; } 50% { height: 64px; } }

.audio-player { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 13px; background: rgba(0,0,0,.25); border: 1px solid var(--border); }
.audio-player.compact { padding: 10px 12px; gap: 10px; }
.audio-play { width: 42px; height: 42px; border-radius: 50%; background: var(--grad-music); color: #062; font-size: 16px; display: grid; place-items: center; flex-shrink: 0; color: #001; }
.audio-player.compact .audio-play { width: 34px; height: 34px; font-size: 13px; }
.audio-wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 38px; }
.audio-wave span { flex: 1; min-width: 2px; border-radius: 2px; background: rgba(255,255,255,.16); transition: background .1s; }
.audio-time { font-size: 12.5px; white-space: nowrap; flex-shrink: 0; }

/* ===== history ===== */
.hist-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.hist-img-card { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.hist-art { width: 100%; }
.hist-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hist-model { font-size: 14px; font-weight: 700; }
.hist-prompt { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hist-list { display: flex; flex-direction: column; gap: 12px; }
.hist-row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; }
.hist-thumb { width: 90px; height: 56px; flex-shrink: 0; }
.hist-row-body { flex: 1; min-width: 0; }
.hist-row-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.status-ok { font-size: 12.5px; color: #34d399; font-weight: 600; }
.hist-sub { font-size: 12.5px; }
.hist-music-row { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.hist-music-head { display: flex; align-items: center; gap: 14px; }
.hist-music-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

/* ===== profile ===== */
.profile { display: flex; flex-direction: column; gap: 36px; }
.prof-section { display: flex; flex-direction: column; gap: 16px; }
.prof-account { display: flex; align-items: center; gap: 18px; padding: 22px 24px; }
.prof-account-meta { flex: 1; }
.pa-name { font-size: 18px; font-weight: 700; }
.prof-balance { padding: 26px 28px; display: flex; flex-direction: column; gap: 22px; }
.prof-balance-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pack { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); transition: all .16s; }
.pack:hover { border-color: rgba(139,92,246,.5); background: rgba(139,92,246,.08); transform: translateY(-2px); }
.pack-amt { font-size: 17px; font-weight: 700; white-space: nowrap; }
.pack-price { font-size: 14px; color: #c4b5fd; font-weight: 700; }
.pack-note { font-size: 13px; }
.sub-grid { gap: 16px; }
.sub-card { padding: 26px; display: flex; flex-direction: column; }
.sub-card.active { border-color: rgba(139,92,246,.5); }
.sub-head { margin-bottom: 18px; }
.sub-head .plan-price { margin: 10px 0 0; }

/* ===== toasts ===== */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 20px; border-radius: 13px; font-size: 14px; font-weight: 600; background: rgba(20,20,30,.92); backdrop-filter: blur(12px); border: 1px solid var(--border-strong); box-shadow: 0 16px 50px -16px rgba(0,0,0,.8); animation: toastIn .3s cubic-bezier(.2,.7,.2,1); }
.toast-ic { font-size: 15px; }
.toast-ok { border-color: rgba(52,211,153,.4); }
.toast-ok .toast-ic { color: #34d399; }
.toast-pay { border-color: rgba(139,92,246,.4); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   TEMPLATE CARDS — стиль Mini App
   ============================================================ */
.tpl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tpl-card {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: transform .15s ease;
}
.tpl-card:hover { transform: scale(1.02); }
.tpl-card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.tpl-card-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(to top, rgba(0,0,0,.78) 0%, transparent 100%);
}
.tpl-card-title {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 6px 8px;
  color: #fff; font-size: 13px; font-weight: 600;
  line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tpl-card-cat {
  position: absolute; bottom: 26px; left: 8px;
  font-size: 9px; font-weight: 700;
  color: rgba(255,255,255,.6);
  text-transform: uppercase; letter-spacing: .5px;
}

/* Табы для страницы трендов */
.tpl-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.tpl-tab-btn {
  padding: 8px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); transition: all .15s;
}
.tpl-tab-btn:hover { border-color: var(--border-strong); color: var(--text); }
.tpl-tab-btn.on {
  background: rgba(139,92,246,.16);
  border-color: rgba(139,92,246,.5);
  color: #fff;
}

/* Горизонтальный скролл категорий */
.tpl-cats {
  display: flex; gap: 8px;
  overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.tpl-cats::-webkit-scrollbar { display: none; }
.cat-chip {
  white-space: nowrap; flex-shrink: 0;
  padding: 6px 14px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); transition: all .15s;
}
.cat-chip:hover { border-color: var(--border-strong); color: var(--text); }
.cat-chip.on {
  background: rgba(139,92,246,.16);
  border-color: rgba(139,92,246,.5);
  color: #fff;
}

/* ============================================================
   WHEEL OF FORTUNE — колесо фортуны
   ============================================================ */
.wheel-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  align-items: start;
}
.wheel-wrap {
  position: relative;
  width: 300px;
  height: 300px;
  flex-shrink: 0;
}
.wheel {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  position: relative;
  border: 6px solid rgba(255,255,255,.14);
  box-shadow: 0 0 0 4px rgba(139,92,246,.3), 0 20px 60px -16px rgba(0,0,0,.7);
  will-change: transform;
}
.wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -24px;
  margin-top: -12px;
  width: 48px;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
  pointer-events: none;
}
.wheel-pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  color: #fde68a;
  z-index: 3;
  text-shadow: 0 2px 6px rgba(0,0,0,.6);
}
.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--surface-solid);
  border: 4px solid rgba(255,255,255,.16);
  display: grid;
  place-items: center;
  font-size: 26px;
  z-index: 2;
}
.wheel-side { min-width: 0; }

@media (max-width: 760px) {
  .wheel-layout { grid-template-columns: 1fr; justify-items: center; }
  .wheel-side { width: 100%; max-width: 360px; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .grid-models { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 920px) {
  .lnav { display: none; }
  .gen-layout { grid-template-columns: 1fr; }
  .gen-result { position: static; min-height: 320px; }
  .dash-grid { grid-template-columns: 1fr; }
  .recent-grid { grid-template-columns: repeat(2, 1fr); }
  .music-models { grid-template-columns: 1fr; }
  .hist-grid { grid-template-columns: repeat(2, 1fr); }
  .sub-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  /* studio mobile: sidebar -> bottomnav */
  .sidebar { display: none; }
  .studio-main { margin-left: 0; }
  .studio-topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 30; padding: 14px 18px;
    background: rgba(10,10,15,.85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
  }
  .studio-main-in { padding: 24px 18px 110px; }
  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: rgba(10,10,15,.92); backdrop-filter: blur(16px); border-top: 1px solid var(--border);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .bnav { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--text-dim); }
  .bnav.on { color: #c4b5fd; }
  .bnav-ic { font-size: 20px; }
  .bnav-l { font-size: 10.5px; font-weight: 600; }
  .vid-row { grid-template-columns: 1.3fr 1fr .8fr; }
  .vid-row span:nth-child(3) { display: none; }
  .vid-head span:nth-child(3) { display: none; }
}
@media (max-width: 560px) {
  .hero-h1 { font-size: 40px; }
  .grid-models { grid-template-columns: 1fr; }
  .recent-grid { grid-template-columns: 1fr; }
  .hist-grid { grid-template-columns: 1fr; }
  .packs { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .lfooter-cols { gap: 32px; }
  .lheader-cta .btn:first-child { display: none; }
  .vid-model { flex-direction: column; align-items: flex-start; }
  .vm-right { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .auth-card { padding: 32px 22px 26px; }
}
