@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── DESIGN SYSTEM — Higgsfield-inspired ──────────────────────────────────
   Фон: чисто чёрный #0a0a0a
   Карточки/панели: #1a1a1a (не bg-2 = серый, а именно тёплый тёмный)
   Элементы управления: #222222
   Hover: #2a2a2a
   Акцент кнопки: белый текст на тёмном — не фиолетовый
   Табы: pill-стиль как у Higgsfield
   Без border/stroke на большинстве элементов
   ─────────────────────────────────────────────────────────────────────── */

:root{
  --bg:         #0a0a0a;
  --panel:      #141414;
  --el:         #1e1e1e;
  --el-hover:   #272727;
  --el-active:  #2e2e2e;

  --border:     rgba(255,255,255,.05);
  --border-l:   rgba(255,255,255,.09);

  --text:       #ffffff;
  --text-2:     #a0a0a0;
  --text-3:     #555555;

  /* Accent — можно сменить одной переменной */
  --acc:        #7c6aff;
  --acc-2:      #9b8aff;
  --acc-dim:    rgba(124,106,255,.12);
  --acc-bd:     rgba(124,106,255,.25);

  --green:      #4ade80;
  --green-dim:  rgba(74,222,128,.08);
  --red:        #f87171;
  --red-dim:    rgba(248,113,113,.08);
  --red-bd:     rgba(248,113,113,.2);
  --yellow:     #fbbf24;
  --yellow-dim: rgba(251,191,36,.08);
  --yellow-bd:  rgba(251,191,36,.2);

  --r:    12px;
  --r-sm: 9px;
  --r-xs: 6px;
  --r-lg: 16px;
  --r-pill: 100px;

  --topbar: 52px;
  --font:  'Inter', sans-serif;
  --mono:  'JetBrains Mono', monospace;
  --shadow: 0 8px 32px rgba(0,0,0,.6);
}

*{ box-sizing:border-box; margin:0; padding:0; }
html,body{ height:100%; background:var(--bg); color:var(--text); font-family:var(--font); font-size:14px; line-height:1.5; -webkit-font-smoothing:antialiased; }
::-webkit-scrollbar{ width:3px; height:3px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.06); border-radius:2px; }
a{ text-decoration:none; color:inherit; }

input,textarea,select{
  background:var(--el); border:none; border-radius:var(--r-sm);
  color:var(--text); font-family:var(--font); font-size:13px; padding:9px 12px;
  outline:none; transition:background .15s, box-shadow .15s; width:100%;
}
input:focus,textarea:focus,select:focus{
  background:var(--el-hover); box-shadow:0 0 0 2px var(--acc-bd);
}
input::placeholder,textarea::placeholder{ color:var(--text-3); }
select option{ background:var(--panel); }
button{ cursor:pointer; font-family:var(--font); transition:all .15s; border:none; outline:none; }

/* ── SHELL ── */
.app{ display:flex; flex-direction:column; height:100vh; overflow:hidden; }
.main-wrap{ flex:1; overflow-y:auto; }

/* ── TOPBAR ── */
.topbar{
  height:var(--topbar); min-height:var(--topbar);
  background:rgba(10,10,10,.92);
  border-bottom:1px solid var(--border);
  backdrop-filter:blur(24px);
  display:flex; align-items:center; padding:0 16px;
  position:sticky; top:0; z-index:100; gap:0;
}
.topbar-logo{ display:flex; align-items:center; gap:9px; margin-right:20px; text-decoration:none; flex-shrink:0; }
.topbar-logo-icon{ width:28px; height:28px; background:var(--acc); border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:900; color:#fff; flex-shrink:0; }
.topbar-logo-text{ font-size:15px; font-weight:700; letter-spacing:-.3px; color:var(--text); }

/* Nav — pill style like Higgsfield */
.topbar-nav{ display:flex; align-items:center; gap:2px; flex:1; overflow-x:auto; scrollbar-width:none; }
.topbar-nav::-webkit-scrollbar{ display:none; }
.nav-item{
  display:flex; align-items:center; gap:5px; padding:5px 12px;
  border-radius:var(--r-pill); color:var(--text-3); font-size:12px; font-weight:500;
  cursor:pointer; white-space:nowrap; flex-shrink:0; background:transparent; border:none;
  transition:color .15s, background .15s;
}
.nav-item:hover{ color:var(--text-2); background:var(--el); }
.nav-item.active{ color:var(--text); background:var(--el-active); }
.nav-item svg{ width:13px; height:13px; flex-shrink:0; }

.topbar-right{ display:flex; align-items:center; gap:7px; margin-left:auto; padding-left:12px; flex-shrink:0; }
.cost-pill{ display:flex; align-items:center; gap:5px; background:var(--el); border-radius:var(--r-pill); padding:4px 11px; font-size:11px; }
.cost-pill-label{ color:var(--text-3); }
.cost-pill-value{ font-family:var(--mono); color:var(--green); font-size:10px; font-weight:700; }
.no-api-pill{ display:flex; align-items:center; gap:5px; background:var(--yellow-dim); border:1px solid var(--yellow-bd); border-radius:var(--r-pill); padding:4px 11px; font-size:11px; font-weight:600; color:var(--yellow); cursor:pointer; }
.user-pill{ display:flex; align-items:center; gap:6px; background:var(--el); border-radius:var(--r-pill); padding:3px 11px 3px 4px; font-size:12px; font-weight:500; color:var(--text-2); }
.user-av-sm{ width:22px; height:22px; background:var(--acc); border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:9px; font-weight:800; color:#fff; }
.logout-btn{ background:transparent; color:var(--text-3); padding:6px; border-radius:var(--r-xs); display:flex; align-items:center; }
.logout-btn:hover{ color:var(--red); }
.logout-btn svg{ width:15px; height:15px; }

.mob-menu-btn{ display:none; background:transparent; color:var(--text-2); padding:5px; border-radius:var(--r-xs); align-items:center; }
.mob-menu-btn svg{ width:20px; height:20px; }
.mob-nav{ display:none; position:fixed; top:var(--topbar); left:0; right:0; bottom:0; background:rgba(10,10,10,.98); border-top:1px solid var(--border); z-index:200; flex-direction:column; padding:10px; gap:3px; }
.mob-nav.show{ display:flex; }
.mob-nav-item{ display:flex; align-items:center; gap:10px; padding:12px 14px; border-radius:var(--r-sm); color:var(--text-2); font-size:14px; font-weight:500; cursor:pointer; background:none; border:none; width:100%; }
.mob-nav-item:hover{ background:var(--el); }
.mob-nav-item.active{ background:var(--el-active); color:var(--text); }
.mob-nav-item svg{ width:18px; height:18px; }

/* ── PAGE ── */
.page{ padding:18px 22px; }
.page-header{ display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.page-title{ font-size:17px; font-weight:700; letter-spacing:-.3px; }
.page-subtitle{ font-size:12px; color:var(--text-3); margin-top:2px; }
.page-actions{ display:flex; gap:8px; align-items:center; }

/* ── BUTTONS ── */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:6px; font-weight:600; border-radius:var(--r-sm); transition:all .15s; white-space:nowrap; font-family:var(--font); border:none; }
.btn:disabled{ opacity:.3; pointer-events:none; }
.btn-xs{ padding:4px 10px; font-size:11px; }
.btn-sm{ padding:6px 13px; font-size:12px; }
.btn-md{ padding:8px 15px; font-size:13px; }
.btn-lg{ padding:10px 20px; font-size:13px; font-weight:700; }
.btn-primary{ background:var(--acc); color:#fff; }
.btn-primary:hover{ background:var(--acc-2); }
.btn-secondary{ background:var(--el); color:var(--text-2); }
.btn-secondary:hover{ background:var(--el-hover); color:var(--text); }
.btn-ghost{ background:transparent; color:var(--text-3); }
.btn-ghost:hover{ background:var(--el); color:var(--text-2); }
.btn-danger{ background:var(--red-dim); color:var(--red); }
.btn-danger:hover{ background:var(--red); color:#fff; }
.btn-success{ background:var(--green-dim); color:var(--green); }

.spinner{ width:13px; height:13px; border:2px solid rgba(255,255,255,.1); border-top-color:#fff; border-radius:50%; animation:spin .6s linear infinite; display:inline-block; }
@keyframes spin{ to{ transform:rotate(360deg); } }

/* ── GENERATE BUTTON ── */
.gen-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:0 24px; height:48px; font-size:14px; font-weight:700;
  background:var(--acc);
  color:#fff; border:none; border-radius:var(--r-sm); cursor:pointer;
  transition:all .15s; font-family:var(--font); white-space:nowrap; flex-shrink:0;
  box-shadow:0 4px 20px rgba(124,106,255,.3);
}
.gen-btn:hover{ background:var(--acc-2); transform:translateY(-1px); box-shadow:0 6px 28px rgba(124,106,255,.4); }
.gen-btn:active{ transform:translateY(0); }
.gen-btn:disabled{ opacity:.3; pointer-events:none; }
.gen-btn svg{ width:14px; height:14px; flex-shrink:0; }
.gen-btn-price{ font-family:var(--mono); font-size:11px; font-weight:600; background:rgba(0,0,0,.2); padding:2px 8px; border-radius:var(--r-pill); }

/* ── MODE TOGGLE — pill style ── */
.mode-toggle{ display:flex; background:var(--el); border-radius:var(--r-pill); padding:3px; gap:2px; }
.mode-btn{ display:flex; align-items:center; gap:5px; padding:5px 14px; border-radius:var(--r-pill); font-size:12px; font-weight:600; background:transparent; color:var(--text-3); border:none; }
.mode-btn svg{ width:12px; height:12px; }
.mode-btn.active{ background:var(--el-active); color:var(--text); }
.mode-btn:hover:not(.active){ color:var(--text-2); }

/* ── LAYOUT GRIDS ── */
.gen-layout{ display:grid; grid-template-columns:274px 1fr; gap:10px; height:calc(100vh - var(--topbar) - 72px); }
.gen-settings{ background:var(--panel); border-radius:var(--r); padding:14px; display:flex; flex-direction:column; gap:12px; overflow-y:auto; }
.gen-main{ display:flex; flex-direction:column; gap:8px; overflow:hidden; }
.results-area{ flex:1; overflow-y:auto; display:grid; grid-template-columns:repeat(auto-fill,minmax(185px,1fr)); gap:8px; align-content:start; padding:2px; }

/* ── PROMPT PANEL ── */
.prompt-panel{ background:var(--panel); border-radius:var(--r); padding:12px 14px; display:flex; flex-direction:column; gap:8px; }
.prompt-row{ display:flex; gap:10px; align-items:flex-end; }
.prompt-wrap{ flex:1; position:relative; }
.prompt-wrap textarea{ resize:none; font-size:13px; line-height:1.6; min-height:50px; max-height:110px; background:var(--el); }
.prompt-hint{ font-size:11px; color:var(--text-3); }
.mentions-dd{ position:absolute; bottom:calc(100% + 6px); left:0; background:var(--panel); border:1px solid var(--border-l); border-radius:var(--r-sm); z-index:200; min-width:180px; max-height:180px; overflow-y:auto; box-shadow:var(--shadow); display:none; }
.mentions-dd.show{ display:block; }
.mention-item{ display:flex; align-items:center; gap:8px; padding:8px 11px; background:transparent; color:var(--text); font-size:12px; width:100%; text-align:left; border-bottom:1px solid var(--border); cursor:pointer; font-family:var(--font); border:none; }
.mention-item:last-child{ border-bottom:none; }
.mention-item:hover{ background:var(--el); }
.mention-av{ width:20px; height:20px; border-radius:50%; object-fit:cover; }

/* ── COUNT ── */
.count-row{ display:flex; align-items:center; gap:8px; }
.count-label{ font-size:11px; color:var(--text-3); white-space:nowrap; }
.count-ctrl{ display:flex; align-items:center; gap:4px; background:var(--el); border-radius:var(--r-xs); padding:3px; }
.count-btn{ width:24px; height:24px; background:transparent; color:var(--text-2); border-radius:3px; font-size:14px; font-weight:700; display:flex; align-items:center; justify-content:center; border:none; }
.count-btn:hover{ background:var(--el-hover); color:var(--text); }
.count-val{ font-family:var(--mono); font-size:13px; font-weight:600; color:var(--text); min-width:18px; text-align:center; }

/* ── FIELD GROUP ── */
.fg{ display:flex; flex-direction:column; gap:6px; }
.fl{ font-size:10px; font-weight:700; color:var(--text-3); text-transform:uppercase; letter-spacing:.7px; }

/* ── PILLS / QUALITY / DUR — rounded pill style ── */
.ratio-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:3px; }
.pill-btn{ padding:7px 3px; background:var(--el); border-radius:var(--r-xs); color:var(--text-2); font-size:11px; font-weight:600; font-family:var(--font); text-align:center; border:none; cursor:pointer; transition:all .15s; }
.pill-btn:hover{ background:var(--el-hover); color:var(--text); }
.pill-btn.active{ background:var(--el-active); color:var(--text); }
.quality-row{ display:flex; gap:3px; }
.quality-btn{ flex:1; padding:8px 3px; background:var(--el); border-radius:var(--r-xs); color:var(--text-2); font-size:11px; font-weight:600; font-family:var(--font); text-align:center; line-height:1.4; cursor:pointer; border:none; transition:all .15s; }
.quality-btn.active{ background:var(--el-active); color:var(--text); }
.quality-btn:hover:not(.active){ background:var(--el-hover); color:var(--text); }
.dur-row{ display:flex; gap:3px; flex-wrap:wrap; }
.dur-btn{ padding:7px 12px; background:var(--el); border-radius:var(--r-pill); color:var(--text-2); font-size:12px; font-weight:600; font-family:var(--font); cursor:pointer; border:none; transition:all .15s; }
.dur-btn.active{ background:var(--el-active); color:var(--text); }
.dur-btn:hover:not(.active){ background:var(--el-hover); color:var(--text); }

/* ── UPLOAD ── */
.upload-area{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; height:78px; background:var(--el); border-radius:var(--r-sm); cursor:pointer; color:var(--text-3); font-size:11px; overflow:hidden; position:relative; transition:background .15s; }
.upload-area:hover{ background:var(--el-hover); color:var(--text-2); }
.upload-area svg{ width:16px; height:16px; }
.upload-preview{ width:100%; height:100%; object-fit:cover; }
.upload-clear{ position:absolute; top:4px; right:4px; width:18px; height:18px; background:rgba(0,0,0,.8); border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:10px; color:#fff; cursor:pointer; z-index:2; }
.upload-clear:hover{ background:var(--red); }

/* ── RESULT CARDS ── */
.result-card{ background:var(--panel); border-radius:var(--r-sm); overflow:hidden; transition:all .15s; }
.result-card:hover{ background:var(--el); transform:translateY(-1px); }
.result-img{ width:100%; aspect-ratio:1; object-fit:cover; display:block; }
.result-video{ width:100%; aspect-ratio:16/9; object-fit:cover; display:block; background:#000; }
.result-meta{ padding:7px 9px; }
.result-prompt-text{ font-size:11px; color:var(--text-3); display:block; }
.result-actions{ padding:0 7px 8px; display:flex; gap:4px; }
.empty-state{ display:flex; flex-direction:column; align-items:center; justify-content:center; height:220px; color:var(--text-3); gap:10px; grid-column:1/-1; font-size:13px; }
.empty-state svg{ width:28px; height:28px; opacity:.1; }

/* ── STATUS BADGES ── */
.badge{ display:inline-flex; align-items:center; gap:4px; padding:3px 8px; border-radius:var(--r-pill); font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; }
.badge-accent{ background:var(--acc-dim); color:var(--acc-2); }
.badge-green{ background:var(--green-dim); color:var(--green); }
.badge-red{ background:var(--red-dim); color:var(--red); }
.badge-yellow{ background:var(--yellow-dim); color:var(--yellow); }
.badge-default{ background:var(--el); color:var(--text-3); }
.badge-generating{ background:var(--yellow-dim); color:var(--yellow); animation:pulse 1.4s infinite; }
@keyframes pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.5; } }

/* ── GOD MODE ── */
.godmode{ display:grid; grid-template-columns:230px 1fr; gap:10px; height:calc(100vh - var(--topbar) - 72px); }
.gm-sidebar{ background:var(--panel); border-radius:var(--r); padding:14px; display:flex; flex-direction:column; gap:12px; }
.gm-cost-box{ background:var(--el); border-radius:var(--r-sm); padding:13px; text-align:center; }
.gm-cost-lbl{ font-size:10px; color:var(--text-3); text-transform:uppercase; letter-spacing:.6px; font-weight:700; }
.gm-cost-val{ font-family:var(--mono); font-size:20px; color:var(--green); font-weight:700; margin-top:3px; }
.gm-cost-cnt{ font-size:11px; color:var(--text-3); margin-top:2px; }
.gm-table{ background:var(--panel); border-radius:var(--r); display:flex; flex-direction:column; overflow:visible; }
.gm-head{ display:grid; grid-template-columns:28px 44px 1fr 100px 46px 80px; gap:6px; padding:8px 12px; background:var(--el); border-bottom:1px solid var(--border); font-size:10px; font-weight:700; color:var(--text-3); text-transform:uppercase; letter-spacing:.6px; }
.gm-body{ flex:1; overflow-y:auto; overflow-x:visible; position:relative; }
.gm-row{ display:grid; grid-template-columns:28px 44px 1fr 100px 46px 80px; gap:6px; padding:5px 12px; border-bottom:1px solid var(--border); align-items:center; transition:background .1s; }
.gm-row:hover{ background:rgba(255,255,255,.02); }
.gm-num{ font-family:var(--mono); font-size:11px; color:var(--text-3); text-align:center; }
.gm-img{ width:40px; height:40px; background:var(--el); border-radius:var(--r-xs); cursor:pointer; display:flex; align-items:center; justify-content:center; color:var(--text-3); overflow:hidden; font-size:16px; transition:background .13s; position:relative; }
.gm-img:hover{ background:var(--el-hover); }
.gm-img img{ width:100%; height:100%; object-fit:cover; }
.gm-inp{ background:var(--el); border:none; border-radius:var(--r-xs); padding:6px 8px; font-size:12px; color:var(--text); width:100%; font-family:var(--font); }
.gm-inp:focus{ outline:none; background:var(--el-hover); }
.gm-thumb{ width:40px; height:40px; object-fit:cover; border-radius:var(--r-xs); }
.gm-gen-btn{ display:inline-flex; align-items:center; justify-content:center; width:32px; height:28px; background:var(--acc); border-radius:var(--r-xs); color:#fff; font-size:12px; font-weight:700; border:none; cursor:pointer; }
.gm-gen-btn:hover{ background:var(--acc-2); }
.gm-gen-btn:disabled{ opacity:.3; pointer-events:none; }
.gm-dl-btn{ display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; background:var(--el); border-radius:var(--r-xs); color:var(--text-2); border:none; cursor:pointer; }
.gm-dl-btn:hover{ background:var(--el-hover); color:var(--text); }

/* ── CARD ── */
.card{ background:var(--panel); border-radius:var(--r); padding:18px; margin-bottom:10px; }
.card-title{ font-size:15px; font-weight:700; letter-spacing:-.2px; margin-bottom:4px; }
.card-desc{ font-size:13px; color:var(--text-2); margin-bottom:14px; line-height:1.6; }
.card-hd{ display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }

/* ── SETTINGS ── */
.settings-layout{ display:grid; grid-template-columns:170px 1fr; gap:14px; }
.settings-tabs{ background:var(--panel); border-radius:var(--r); padding:5px; height:fit-content; display:flex; flex-direction:column; gap:1px; }
.stab{ display:flex; align-items:center; gap:8px; padding:9px 12px; border-radius:var(--r-sm); font-size:13px; font-weight:500; background:transparent; color:var(--text-3); border:none; width:100%; font-family:var(--font); transition:all .15s; text-align:left; }
.stab svg{ width:13px; height:13px; }
.stab:hover{ background:var(--el); color:var(--text-2); }
.stab.active{ background:var(--el-active); color:var(--text); }
.support-link{ display:flex; align-items:center; gap:7px; padding:9px 12px; font-size:13px; color:var(--text-3); margin-top:6px; border-top:1px solid var(--border); padding-top:10px; }
.support-link:hover{ color:var(--acc-2); }
.api-key-row{ display:flex; gap:8px; align-items:center; }
.api-key-wrap{ flex:1; position:relative; }
.show-key-btn{ position:absolute; right:10px; top:50%; transform:translateY(-50%); background:none; border:none; color:var(--text-3); display:flex; align-items:center; padding:0; }
.show-key-btn svg{ width:14px; height:14px; }
.show-key-btn:hover{ color:var(--text); }
.fal-link{ display:inline-flex; align-items:center; gap:5px; margin-top:9px; font-size:12px; color:var(--acc-2); }
.price-list{ display:flex; flex-direction:column; }
.price-row{ display:flex; align-items:center; padding:7px 0; border-bottom:1px solid var(--border); gap:8px; }
.price-row:last-child{ border-bottom:none; }
.price-model{ font-size:13px; color:var(--text-2); flex:1; }
.price-type{ font-size:10px; color:var(--text-3); background:var(--el); padding:2px 6px; border-radius:4px; white-space:nowrap; }
.price-inp{ width:76px; font-family:var(--mono); font-size:13px; text-align:right; }
.users-list{ display:flex; flex-direction:column; gap:5px; }
.user-row{ display:flex; align-items:center; gap:9px; padding:9px 12px; background:var(--el); border-radius:var(--r-sm); }
.u-av{ width:32px; height:32px; border-radius:50%; background:var(--acc); color:#fff; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:800; min-width:32px; }
.u-info{ flex:1; }
.u-name{ font-size:13px; font-weight:600; color:var(--text); }
.u-role{ font-size:11px; color:var(--text-3); text-transform:capitalize; }
.add-form{ background:var(--el); border-radius:var(--r); padding:12px; margin-bottom:12px; }

/* ── CHARS ── */
.char-list{ display:flex; flex-direction:column; gap:5px; }
.char-card{ display:flex; align-items:center; gap:11px; background:var(--panel); border-radius:var(--r-sm); padding:9px 13px; transition:background .15s; }
.char-card:hover{ background:var(--el); }
.char-av{ width:38px; height:38px; min-width:38px; border-radius:50%; overflow:hidden; background:var(--el); display:flex; align-items:center; justify-content:center; color:var(--text-3); }
.char-av img{ width:100%; height:100%; object-fit:cover; }
.char-info{ flex:1; }
.char-name{ font-size:13px; font-weight:600; color:var(--text); }
.char-at{ font-size:11px; color:var(--acc-2); font-family:var(--mono); }
.char-hint{ background:var(--el); border-radius:var(--r-sm); padding:9px 13px; font-size:12px; color:var(--text-2); margin-bottom:12px; line-height:1.6; }
.char-hint code{ background:var(--acc-dim); color:var(--acc-2); padding:1px 4px; border-radius:3px; font-family:var(--mono); }
.char-empty{ display:flex; flex-direction:column; align-items:center; justify-content:center; height:160px; color:var(--text-3); gap:8px; }
.add-form-inner{ display:flex; gap:12px; align-items:flex-start; }
.add-img-upload{ width:68px; height:68px; min-width:68px; background:var(--el); border-radius:var(--r-sm); cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; color:var(--text-3); font-size:11px; overflow:hidden; transition:background .15s; }
.add-img-upload:hover{ background:var(--el-hover); color:var(--text-2); }
.add-img-upload img{ width:100%; height:100%; object-fit:cover; }
.add-img-upload svg{ width:16px; height:16px; }
.add-fields{ flex:1; display:flex; flex-direction:column; gap:9px; }
.del-btn{ background:transparent; color:var(--text-3); padding:5px; border-radius:var(--r-xs); border:none; display:flex; align-items:center; transition:all .15s; }
.del-btn:hover{ color:var(--red); }

/* ── VIDEO ── */
.vid-left{ background:var(--panel); border-radius:var(--r); display:flex; flex-direction:column; overflow:hidden; }
.vid-main{ display:flex; flex-direction:column; gap:8px; overflow:hidden; }
.vid-canvas{ flex:1; background:var(--panel); border-radius:var(--r); display:flex; align-items:center; justify-content:center; overflow:hidden; }
.vid-canvas video{ width:100%; height:100%; object-fit:contain; }

/* Frame slots — Higgsfield big card style */
.frame-slot-card{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
  background:var(--el); border-radius:var(--r-sm); cursor:pointer; min-height:110px;
  padding:12px; text-align:center; position:relative; overflow:hidden; transition:background .15s;
}
.frame-slot-card:hover{ background:var(--el-hover); }
.frame-slot-card img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; border-radius:var(--r-sm); }
.frame-slot-icon{ width:42px; height:42px; background:var(--el-active); border-radius:50%; display:flex; align-items:center; justify-content:center; color:var(--text-3); }
.frame-slot-icon svg{ width:18px; height:18px; }
.frame-slot-label{ font-size:13px; font-weight:500; color:var(--text-2); }
.frame-slot-sub{ font-size:10px; color:var(--text-3); position:absolute; top:7px; right:9px; background:var(--el-active); padding:2px 7px; border-radius:var(--r-pill); }
.frame-slot-clear{ position:absolute; top:6px; right:6px; width:20px; height:20px; background:rgba(0,0,0,.8); border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:10px; color:#fff; cursor:pointer; z-index:3; }
.frame-slot-clear:hover{ background:var(--red); }

/* ── HOLLYWOOD ── */
.hw-layout{ display:grid; grid-template-columns:274px 1fr; gap:10px; height:calc(100vh - var(--topbar) - 72px); }
.hw-settings{ background:var(--panel); border-radius:var(--r); padding:14px; display:flex; flex-direction:column; gap:12px; overflow-y:auto; }
.hw-sect{ font-size:10px; font-weight:700; color:var(--text-3); text-transform:uppercase; letter-spacing:.7px; padding-bottom:7px; border-bottom:1px solid var(--border); }
.apt-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:3px; }
.apt-btn{ padding:7px 3px; font-size:11px; font-weight:600; background:var(--el); border-radius:var(--r-xs); color:var(--text-2); font-family:var(--font); text-align:center; cursor:pointer; border:none; transition:all .15s; }
.apt-btn.active{ background:var(--el-active); color:var(--text); }
.apt-btn:hover:not(.active){ background:var(--el-hover); color:var(--text); }
.hw-prev-box{ background:var(--el); border-radius:var(--r-sm); padding:11px; }
.hw-prev-text{ font-size:11px; color:var(--text-2); line-height:1.6; font-family:var(--mono); margin-top:5px; word-break:break-word; }
.hw-main{ display:flex; flex-direction:column; gap:8px; overflow:hidden; }
.hw-results{ flex:1; overflow-y:auto; display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:8px; align-content:start; }
.hw-img{ width:100%; aspect-ratio:16/9; object-fit:cover; display:block; }

/* ── ASSETS ── */
.assets-filters{ display:flex; gap:7px; margin-bottom:14px; flex-wrap:wrap; align-items:center; }
.assets-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(185px,1fr)); gap:9px; }
.asset-card{ background:var(--panel); border-radius:var(--r-sm); overflow:hidden; transition:all .15s; cursor:pointer; position:relative; }
.asset-card:hover{ background:var(--el); transform:translateY(-1px); }
.asset-card.selected{ box-shadow:0 0 0 2px var(--acc); }
.asset-thumb{ width:100%; aspect-ratio:16/9; object-fit:cover; display:block; background:var(--el); }
.asset-check{ position:absolute; top:7px; left:7px; width:19px; height:19px; border-radius:50%; background:var(--acc); display:none; align-items:center; justify-content:center; }
.asset-card.selected .asset-check{ display:flex; }
.asset-meta{ padding:7px 9px; display:flex; flex-direction:column; gap:2px; }
.asset-name{ font-size:12px; color:var(--text-2); font-weight:500; }
.asset-sub{ font-size:10px; color:var(--text-3); }
.asset-actions{ padding:0 7px 7px; display:flex; gap:3px; }
.assets-empty{ display:flex; flex-direction:column; align-items:center; justify-content:center; height:260px; color:var(--text-3); gap:11px; }
.assets-sel-bar{ display:flex; align-items:center; gap:9px; padding:9px 13px; background:var(--acc-dim); border-radius:var(--r-sm); margin-bottom:12px; font-size:13px; color:var(--acc-2); font-weight:600; }

/* ── LOG ── */
.log-list{ display:flex; flex-direction:column; gap:3px; max-height:480px; overflow-y:auto; }
.log-entry{ display:flex; align-items:flex-start; gap:9px; padding:7px 10px; background:var(--el); border-radius:var(--r-xs); font-size:12px; }
.log-time{ font-family:var(--mono); color:var(--text-3); white-space:nowrap; font-size:10px; }
.log-msg{ color:var(--text-2); flex:1; line-height:1.5; }
.log-entry.log-ok .log-msg{ color:var(--green); }
.log-entry.log-err .log-msg{ color:var(--red); }
.log-entry.log-warn .log-msg{ color:var(--yellow); }

/* ── LOGIN ── */
.login-page{ min-height:100vh; display:flex; align-items:center; justify-content:center; background:var(--bg); }
.login-bg{ position:absolute; inset:0; background:radial-gradient(ellipse 50% 35% at 50% 0%,rgba(124,106,255,.07) 0%,transparent 70%); pointer-events:none; }
.login-box{ width:100%; max-width:340px; background:var(--panel); border-radius:var(--r-lg); padding:28px 24px; position:relative; z-index:1; box-shadow:var(--shadow); }
.login-logo{ text-align:center; margin-bottom:22px; }
.login-logo-icon{ width:46px; height:46px; background:var(--acc); border-radius:13px; display:flex; align-items:center; justify-content:center; margin:0 auto 10px; font-size:22px; font-weight:900; color:#fff; }
.login-logo h1{ font-size:20px; font-weight:800; letter-spacing:-.4px; color:var(--text); }
.login-logo p{ font-size:12px; color:var(--text-3); margin-top:2px; }
.login-form{ display:flex; flex-direction:column; gap:13px; }
.form-group{ display:flex; flex-direction:column; gap:5px; }
.form-label{ font-size:10px; font-weight:700; color:var(--text-3); text-transform:uppercase; letter-spacing:.6px; }
.login-error{ background:var(--red-dim); color:var(--red); padding:8px 12px; border-radius:var(--r-sm); font-size:12px; }

/* ── MODAL ── */
.modal-overlay{ position:fixed; inset:0; background:rgba(0,0,0,.75); backdrop-filter:blur(4px); z-index:9999; display:flex; align-items:center; justify-content:center; }
.modal{ background:var(--panel); border-radius:var(--r-lg); padding:24px 20px; max-width:380px; width:90%; box-shadow:var(--shadow); }
.modal-title{ font-size:15px; font-weight:700; margin-bottom:7px; }
.modal-body{ font-size:13px; color:var(--text-2); line-height:1.6; margin-bottom:18px; }
.modal-actions{ display:flex; gap:7px; justify-content:flex-end; }

/* MISC */
.divider{ border:none; border-top:1px solid var(--border); margin:12px 0; }
.nsfw-badge{ display:inline-flex; align-items:center; gap:4px; background:var(--red-dim); border-radius:var(--r-pill); padding:2px 8px; font-size:10px; font-weight:700; color:var(--red); text-transform:uppercase; }

/* ── RESPONSIVE ── */
@media(max-width:900px){
  .topbar-nav{ display:none; }
  .mob-menu-btn{ display:flex; }
  /* Stack layouts vertically */
  .gen-layout{ grid-template-columns:1fr; height:auto; }
  .godmode{ grid-template-columns:1fr; height:auto; }
  .hw-layout{ grid-template-columns:1fr; height:auto; }
  .settings-layout{ grid-template-columns:1fr; }
  /* Show all panels on mobile */
  .gen-settings{ max-height:none; }
  /* Video layout */
  #vid-grid{ grid-template-columns:1fr !important; height:auto !important; }
  #vid-left{ max-height:60vh; }
  #vid-canvas{ min-height:200px; }
}
@media(max-width:560px){
  .page{ padding:12px; }
  .topbar{ padding:0 10px; }
  .cost-pill{ display:none; }
}


/* ── Hollywood section icon gap ── */
.hw-sect svg{ margin-right:6px; }

/* ── Pricing — wider price input ── */
.price-inp{ width:110px !important; }

/* ── Team Members — highlighted input fields ── */
#new-name, #new-uname, #new-pass{
  background:var(--el-hover) !important;
  box-shadow:0 0 0 1px var(--acc-bd);
}
#new-name:focus, #new-uname:focus, #new-pass:focus{
  box-shadow:0 0 0 2px var(--acc-bd);
}

/* ── Hollywood section icon spacing ── */
.hw-sect svg { margin-right:6px; flex-shrink:0; }

/* ── Pricing — wider price input ── */
.price-inp { width:110px !important; }

/* ── Team Members — highlighted inputs ── */
#new-name, #new-uname, #new-pass {
  background:var(--el-hover) !important;
  box-shadow:inset 0 0 0 1px var(--acc-bd);
}
#new-name:focus, #new-uname:focus, #new-pass:focus {
  box-shadow:inset 0 0 0 1.5px var(--acc), 0 0 0 2px var(--acc-dim) !important;
}

/* ── Characters — highlighted name field and image upload ── */
#char-name-inp {
  background:var(--el-hover) !important;
  box-shadow:inset 0 0 0 1px var(--acc-bd);
}
#char-name-inp:focus {
  box-shadow:inset 0 0 0 1.5px var(--acc), 0 0 0 2px var(--acc-dim) !important;
}
.add-img-upload {
  box-shadow:inset 0 0 0 1px var(--acc-bd);
}
.add-img-upload:hover {
  box-shadow:inset 0 0 0 1.5px var(--acc);
}

/* ── God Mode — ensure sidebar always visible on desktop ── */
@media(min-width:901px){
  .gm-sidebar { display:flex !important; }
  .gen-settings { display:flex !important; }
  .hw-settings { display:flex !important; }
}

/* God Mode — larger ref cell row height */
.gm-row { min-height: 80px; align-items: center; }
.gm-body .gm-row { padding: 6px 12px; }
