/* aireels v2 — Dark Cinema Production UI (1-in-1 from approved Stage 1 prototype)
   Pure Dark (#09090B + #D1FE17), ZERO light theme, ZERO emojis, 100% CSP-safe. */
:root {
  --canvas: #09090B;
  --surface: #131317;
  --subtle: #1B1B22;
  --elevated: #22222C;
  --text: #F5F5F7;
  --sec: #B2B2BE;
  --mut: #8E8E9B;
  --border: #26262F;
  --border-str: #3A3A46;
  --lime: #D1FE17;
  --on-lime: #09090B;
  --ai: #7C7DFF;
  --ai-soft: #1E1E38;
  --ok: #2EE587;
  --ok-soft: #102B1D;
  --danger: #FF4D6D;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  background: var(--canvas);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
}
/* AMBIENT CINEMA PROJECTOR AURORA BACKDROP (60FPS GPU) */
body::before, body::after {
  content: ''; position: fixed; pointer-events: none; z-index: 0; border-radius: 999px; filter: blur(110px);
}
body::before {
  width: 560px; height: 560px; top: -180px; left: -120px;
  background: radial-gradient(circle, rgba(124, 125, 255, 0.14) 0%, rgba(255, 46, 147, 0.08) 45%, transparent 72%);
  animation: driftOrb1 16s ease-in-out infinite alternate;
}
body::after {
  width: 520px; height: 520px; bottom: -160px; right: -100px;
  background: radial-gradient(circle, rgba(209, 254, 23, 0.1) 0%, rgba(67, 97, 238, 0.09) 48%, transparent 72%);
  animation: driftOrb2 18s ease-in-out infinite alternate;
}
@keyframes driftOrb1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(90px, 60px) scale(1.12); } }
@keyframes driftOrb2 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-80px, -50px) scale(1.14); } }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes btnShine {
  0% { transform: translateX(-140%) skewX(-22deg); }
  35%, 100% { transform: translateX(260%) skewX(-22deg); }
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 229, 135, 0.7); }
  50% { box-shadow: 0 0 0 6px rgba(46, 229, 135, 0); }
}
@keyframes shimmerFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.app-shell { position: relative; z-index: 1; width: 100%; min-height: 100vh; display: flex; flex-direction: column; }
.live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 999px; background: var(--ok);
  margin-right: 6px; vertical-align: middle; animation: livePulse 2s ease-in-out infinite;
}
.display { font-family: 'Unbounded', sans-serif; letter-spacing: -0.02em; }
svg.ic { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.ic-lg { width: 18px; height: 18px; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* MCP FUTURISTIC MATRIX / DOT-GRID HERO BACKDROP */
.mcp-hero-stage {
  position: relative; padding: 36px 24px 32px; border-radius: 26px; overflow: hidden; margin-bottom: 26px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(209, 254, 23, 0.16) 0%, rgba(124, 125, 255, 0.12) 38%, rgba(9, 9, 11, 0.96) 78%),
    radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.12);
}

/* CURSOR-TRACKING SPOTLIGHT GLASS GLOW */
.panel, .q-tile {
  position: relative; overflow: hidden;
  background-image: radial-gradient(280px circle at var(--mx, -200px) var(--my, -200px), rgba(209, 254, 23, 0.09), transparent 65%);
}
.panel::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, -200px) var(--my, -200px), rgba(209, 254, 23, 0.45), rgba(124, 125, 255, 0.25) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .25s;
}
.panel:hover::before { opacity: 1; }

/* Top Nav */
.topnav {
  position: sticky; top: 0; z-index: 40;
  height: 64px; padding: 0 24px;
  background: rgba(19,19,23,0.92); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; flex-shrink: 0; }
.brand img { width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.14); object-fit: cover; }
.brand-name { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: -0.03em; }
.pill-new { font-size: 10px; font-weight: 700; color: var(--lime); background: var(--subtle); border: 1px solid var(--border); padding: 3px 8px; border-radius: 999px; }

.nav-tabs { display: flex; align-items: center; gap: 4px; background: var(--subtle); padding: 4px; border-radius: 999px; border: 1px solid var(--border); }
.nav-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; font-weight: 500; color: var(--sec); font-size: 12px; transition: .15s; white-space: nowrap;
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active { background: var(--lime); color: var(--on-lime); font-weight: 700; }
.nav-tab.ai-tab { color: var(--ai); }
.nav-tab.ai-tab.active { background: var(--ai); color: #fff; }
.nav-tab.suno-tab { color: var(--lime); }
.nav-tab.suno-tab.active { background: var(--lime); color: var(--on-lime); }
.nav-more-wrap { position: relative; }
.nav-more-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 178px; z-index: 60;
  background: rgba(19, 19, 23, 0.98); backdrop-filter: blur(16px);
  border: 1px solid var(--border-str); border-radius: 16px; padding: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  display: flex; flex-direction: column; gap: 4px;
}
.nav-more-menu[hidden] { display: none; }
.nav-more-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 11px; font-size: 13px; font-weight: 600; color: var(--text);
  transition: background .15s, color .15s;
}
.nav-more-item:hover { background: var(--subtle); }
.nav-more-item.active { background: var(--lime); color: var(--on-lime); }

/* SUNO MUSIC STUDIO */
.suno-hero-bar {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px;
  padding: 22px 24px; border-radius: 22px; margin-bottom: 20px;
  border: 1px solid rgba(209, 254, 23, 0.24);
  background: radial-gradient(ellipse at 12% 0%, rgba(209, 254, 23, 0.14) 0%, rgba(124, 125, 255, 0.1) 42%, rgba(19, 19, 23, 0.96) 80%);
}
.suno-shell {
  display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start;
}
.suno-tracks-pane {
  position: sticky; top: 76px;
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.suno-tracks-scroll {
  max-height: calc(100vh - 210px); overflow-y: auto; padding-right: 4px;
  display: flex; flex-direction: column; gap: 10px;
}
.suno-studio-main { min-width: 0; }
.suno-top-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.suno-genre-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.suno-composer { display: flex; flex-direction: column; gap: 14px; }
.suno-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.suno-row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.suno-field { display: flex; flex-direction: column; gap: 7px; }
.suno-label { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--sec); text-transform: uppercase; }
.suno-textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.suno-custom-fields { display: flex; flex-direction: column; gap: 12px; }
.suno-custom-fields[hidden], .suno-live-status[hidden], .suno-ai-box[hidden], .suno-upload-box[hidden], .suno-upload-preview[hidden] { display: none; }
.suno-ai-box {
  background: #141424; border: 1px solid rgba(124, 125, 255, 0.45); border-radius: 16px; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.suno-ai-composer { display: flex; flex-direction: column; gap: 8px; }
.suno-ai-textarea {
  width: 100%; min-height: 76px; max-height: 200px; padding: 10px 12px;
  font-size: 13px; line-height: 1.45; resize: vertical; font-family: inherit;
}
.v2-mic-btn { display: inline-flex; align-items: center; gap: 5px; }
.v2-mic-btn.is-listening {
  border-color: #FF4D6D !important; background: rgba(255, 77, 109, 0.18) !important; color: #FF94A8 !important;
  animation: v2-mic-pulse 1.2s ease-in-out infinite;
}
@keyframes v2-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(255, 77, 109, 0); }
}
.suno-ai-log { display: flex; flex-direction: column; gap: 8px; max-height: 210px; overflow-y: auto; }
.suno-ai-msg {
  padding: 9px 11px; border-radius: 12px; font-size: 12px; line-height: 1.45;
  display: flex; flex-direction: column; gap: 6px;
}
.suno-ai-msg.is-bot { background: rgba(124, 125, 255, 0.14); border: 1px solid rgba(124, 125, 255, 0.28); color: #EAEAFF; }
.suno-ai-msg.is-user { background: var(--surface); border: 1px solid var(--border); color: var(--text); align-self: flex-end; max-width: 90%; }
.suno-upload-box {
  background: rgba(9, 9, 11, 0.65); border: 1px solid var(--border-str); border-radius: 16px; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.suno-dropzone {
  border: 1px dashed rgba(209, 254, 23, 0.45); border-radius: 12px; padding: 14px 12px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; cursor: pointer;
  background: rgba(209, 254, 23, 0.04); transition: border-color .15s, background .15s;
}
.suno-dropzone:hover { border-color: var(--lime); background: rgba(209, 254, 23, 0.09); }
.suno-upload-preview { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.suno-live-status {
  padding: 12px 14px; border-radius: 14px; font-size: 12px;
  background: rgba(124, 125, 255, 0.12); border: 1px solid rgba(124, 125, 255, 0.4); color: #E4E4FF;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.suno-live-status.is-err { background: rgba(255, 77, 109, 0.12); border-color: rgba(255, 77, 109, 0.45); color: #FFD1DA; }
.suno-live-status.is-ok { background: rgba(46, 229, 135, 0.12); border-color: rgba(46, 229, 135, 0.45); color: #C9FFE2; }
.suno-tracks-list { display: flex; flex-direction: column; gap: 12px; }
.suno-empty {
  padding: 22px 18px; border-radius: 16px; border: 1px dashed var(--border-str);
  background: rgba(9, 9, 11, 0.55); text-align: center; color: var(--sec); font-size: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.suno-track-card {
  display: grid; grid-template-columns: 74px 1fr; gap: 14px; align-items: center;
  padding: 14px; border-radius: 16px; background: var(--canvas); border: 1px solid var(--border);
  transition: border-color .15s;
}
.suno-track-card:hover { border-color: rgba(209, 254, 23, 0.55); }
.suno-track-cover {
  width: 74px; height: 74px; border-radius: 12px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(209, 254, 23, 0.22), rgba(124, 125, 255, 0.28));
  border: 1px solid var(--border-str); display: flex; align-items: center; justify-content: center; color: var(--lime);
}
.suno-track-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.suno-track-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.suno-track-title { font-family: 'Unbounded', sans-serif; font-size: 13px; font-weight: 700; color: #fff; }
.suno-track-tags { font-size: 11px; color: var(--sec); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suno-track-audio { width: 100%; height: 34px; accent-color: var(--lime); }
/* Живой результат генерации: видео в инспекторе, фото в просмотре */
.v-result-box[hidden] { display: none; }
.v-result-box { display: flex; flex-direction: column; gap: 10px; }
.v-result-video { width: 100%; max-height: 62vh; border-radius: 14px; border: 1px solid var(--border-str); background: #000; display: block; }
.v-result-status { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; border: 1px dashed var(--border-str); font-size: 12px; color: #D4D4D8; }
.v-result-status.is-err { border-color: rgba(255, 90, 90, 0.5); color: #FFB4B4; }
.v-result-spin { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid rgba(209, 254, 23, 0.25); border-top-color: var(--lime); animation: v-result-spin 0.9s linear infinite; }
@keyframes v-result-spin { to { transform: rotate(360deg); } }
.v-result-dl { display: block; width: 100%; text-align: center; text-decoration: none; box-sizing: border-box; }
.hf-photo-card.is-fresh { outline: 2px solid var(--lime); outline-offset: -2px; }
.hf-photo-pending {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 20px 16px; text-align: center; cursor: default;
  background: linear-gradient(135deg, #121218 0%, #1C1C26 50%, #121218 100%);
  background-size: 220% 220%;
  outline: 2px solid var(--lime); outline-offset: -2px;
  animation: hf-photo-shimmer 2.2s ease-in-out infinite;
}
@keyframes hf-photo-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hf-photo-pending-spin {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(209, 254, 23, 0.2); border-top-color: var(--lime);
  animation: v-result-spin 0.85s linear infinite;
}
.hf-photo-pending-badge {
  font-family: 'Unbounded', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; color: var(--lime); text-transform: uppercase;
}
.hf-photo-pending-model { font-size: 13px; font-weight: 700; color: #fff; }
.hf-photo-pending-prompt {
  font-size: 11px; color: var(--sec); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  max-width: 100%;
}
.hf-photo-pending-timer {
  font-size: 11px; font-weight: 700; color: #E4E4E7;
  padding: 4px 10px; border-radius: 999px; background: rgba(9, 9, 11, 0.72); border: 1px solid var(--border-str);
}
.hf-photo-pending-hint { font-size: 10px; color: var(--mut); }
/* Центральное окно генерации (Видео / Фото / Suno) с прогресс-баром и примерным временем */
.v2-gen-stage[hidden] { display: none; }
.v2-gen-stage {
  width: 100%; max-width: 720px; margin: 0 auto 18px;
  border-radius: 20px; padding: 20px;
  background: linear-gradient(145deg, #13131A 0%, #1B1B26 50%, #121218 100%);
  border: 1.5px solid rgba(209, 254, 23, 0.55);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(209, 254, 23, 0.14) inset;
  display: flex; flex-direction: column; gap: 14px;
}
.v2-gen-stage.is-photo { max-width: 560px; margin: 8px auto 18px; }
.v2-gen-stage.is-compact { max-width: 100%; margin: 0; padding: 16px; }
.v2-gen-stage.is-err { border-color: rgba(255, 90, 90, 0.6); }
.v2-gen-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.v2-gen-stage-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Unbounded', sans-serif; font-size: 11px; font-weight: 700; color: var(--lime); letter-spacing: 0.04em;
}
.v2-gen-stage-eta {
  font-size: 12px; font-weight: 600; color: #E4E4E7;
  padding: 4px 11px; border-radius: 999px; background: rgba(9, 9, 11, 0.75); border: 1px solid var(--border-str);
}
.v2-gen-stage-frame {
  position: relative; width: 100%; min-height: 220px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(125deg, #0D0D12 0%, #1C1C29 45%, #0D0D12 100%);
  background-size: 220% 220%; animation: hf-photo-shimmer 2.4s ease-in-out infinite;
  border: 1px solid var(--border-str);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px 18px; text-align: center;
}
.v2-gen-stage.is-compact .v2-gen-stage-frame { min-height: 110px; padding: 16px; }
.v2-gen-stage-pct { font-family: 'Unbounded', sans-serif; font-size: 22px; font-weight: 800; color: #fff; }
.v2-gen-stage-prompt { font-size: 12px; color: var(--sec); max-width: 520px; line-height: 1.45; }
.v2-gen-bar-track {
  width: 100%; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.09); overflow: hidden;
}
.v2-gen-bar-fill {
  height: 100%; width: 6%; border-radius: 999px;
  background: linear-gradient(90deg, var(--lime) 0%, #A3FF47 100%);
  transition: width 0.8s ease;
}
.v2-gen-stage-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 11px; color: var(--sec);
}
.v2-gen-stage-media { width: 100%; max-height: 52vh; object-fit: contain; border-radius: 14px; background: #000; display: block; border: 1px solid var(--border-str); }
.v2-gen-stage-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.v2-gen-stage-actions > * { flex: 1; min-width: 160px; }
.suno-track-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.suno-presets-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.suno-preset-card {
  text-align: left; padding: 14px; border-radius: 16px; background: var(--canvas); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px; transition: border-color .18s, transform .18s;
}
.suno-preset-card:hover { border-color: var(--lime); transform: translateY(-2px); }
.suno-preset-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.suno-preset-name { font-family: 'Unbounded', sans-serif; font-size: 12px; font-weight: 700; color: #fff; }
.suno-preset-desc { font-size: 11px; color: var(--sec); line-height: 1.45; }

.nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--sec); transition: .15s; white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--border-str); color: var(--text); }
.btn-credits {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--ai-soft); color: var(--ai); border: 1px solid rgba(124,125,255,0.3); transition: .15s; white-space: nowrap;
}
.btn-credits.active { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.btn-prof {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 5px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--subtle); border: 1px solid var(--border); transition: .15s; white-space: nowrap;
}
.btn-prof.active { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.btn-prof img { width: 24px; height: 24px; border-radius: 999px; object-fit: cover; }

.btn-lime {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, #D9FF2E 0%, #C4F50F 100%); color: var(--on-lime);
  box-shadow: 0 4px 22px rgba(209, 254, 23, 0.24);
  transition: transform .16s, box-shadow .2s, filter .15s;
}
.btn-lime::after {
  content: ''; position: absolute; top: 0; left: 0; width: 42%; height: 100%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
  animation: btnShine 4.2s ease-in-out infinite;
}
.btn-lime:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 8px 30px rgba(209, 254, 23, 0.44); }
.btn-ai {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, #8B8CFF 0%, #635BFF 100%); color: #fff;
  box-shadow: 0 4px 20px rgba(124, 125, 255, 0.3); transition: .18s;
}
.btn-ai:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(124, 125, 255, 0.5); }
.btn-dark {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 12px;
  background: var(--subtle); color: var(--text); border: 1px solid var(--border-str); transition: .15s;
}
.btn-dark:hover { border-color: var(--text); }
.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: 999px; font-weight: 600; font-size: 12px;
  background: rgba(255, 77, 109, 0.12); color: var(--danger); border: 1px solid rgba(255, 77, 109, 0.4); transition: .15s;
}
.btn-danger:hover { background: rgba(255, 77, 109, 0.2); }

/* Screens */
.screen { display: none; padding: 24px 32px 44px; max-width: 1440px; width: 100%; margin: 0 auto; flex: 1; }
.screen.active { display: block; animation: screenIn .24s cubic-bezier(.22,1,.36,1); }
.screen.full-bleed { padding: 0; max-width: none; }

/* Mobile / TMA Bottom Tab Bar */
.mobile-tabbar { display: none; }
.mtab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 8px; border-radius: 12px; font-size: 10px; font-weight: 600; color: var(--sec); }
.mtab.active { background: var(--lime); color: var(--on-lime); }
.mtab.ai-mtab.active { background: var(--ai); color: #fff; }

/* Models Value-Prop Strip on Explore */
.models-strip-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px; border-radius: 16px;
  background: linear-gradient(90deg, rgba(209,254,23,0.08) 0%, rgba(19,19,23,0.92) 45%, rgba(124,125,255,0.08) 100%);
  border: 1px solid rgba(209,254,23,0.22);
}
.models-strip-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.models-strip-text { font-size: 12px; color: var(--sec); line-height: 1.4; }
.models-strip-text strong { color: var(--text); }
.models-strip-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.models-strip-links .chip { padding: 5px 11px; font-size: 11px; border-color: rgba(255,255,255,0.14); }
.models-strip-links .chip:hover { border-color: var(--lime); color: var(--lime); }

/* Quick Strip */
.quick-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }
.q-tile {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; text-align: left; transition: .15s; min-width: 0;
}
.q-tile:hover { border-color: var(--lime); transform: translateY(-2px); }
.q-tile img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.q-title { font-family: 'Unbounded', sans-serif; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag-sm { font-family: 'Inter', sans-serif; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 999px; }

/* Section Header */
.sec-hdr { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.sec-title { font-family: 'Unbounded', sans-serif; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.chip-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--surface); color: var(--sec); border: 1px solid var(--border); transition: .15s;
}
.chip:hover { color: var(--text); border-color: var(--border-str); }
.chip.active { background: var(--lime); color: var(--on-lime); border-color: var(--lime); font-weight: 700; }
.chip.ai-active { background: var(--ai); color: #fff; border-color: var(--ai); }
.chip[hidden], [hidden] { display: none !important; }

/* 4-Col Variable Masonry */
.masonry-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.m-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.v-card {
  position: relative; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1); background: #000; cursor: pointer;
  transition: transform .24s cubic-bezier(.22,1,.36,1), border-color .22s, box-shadow .24s;
}
.v-card:hover {
  transform: translateY(-4px); border-color: rgba(209,254,23,0.75);
  box-shadow: 0 18px 42px rgba(0,0,0,0.65), 0 0 24px rgba(209,254,23,0.16);
}
.v-card img, .v-card video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .55s cubic-bezier(.22,1,.36,1); }
.v-card:hover img, .v-card:hover video { transform: scale(1.06); }
.v-card:hover .v-recreate { box-shadow: 0 0 18px rgba(209,254,23,0.65); transform: scale(1.05); }
.v-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(9,9,11,0.08) 0%, rgba(9,9,11,0) 42%, rgba(9,9,11,0.92) 100%);
}
.v-top {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: rgba(9,9,11,0.74); backdrop-filter: blur(8px);
  padding: 4px 9px; border-radius: 999px; font-size: 10px; font-weight: 600; color: #fff;
}
.v-bot { position: absolute; bottom: 12px; left: 12px; right: 12px; z-index: 2; display: flex; flex-direction: column; gap: 8px; }
.v-name { font-family: 'Unbounded', sans-serif; font-size: 12px; font-weight: 600; color: #fff; }
.v-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.v-meta { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: #C4C4CC; font-weight: 500; }
.v-recreate {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--lime); color: var(--on-lime); transition: .15s;
}
.v-pick-subtle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(24, 24, 32, 0.86); color: #F5F5F7; border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(8px); transition: border-color .15s, background .15s;
}
.v-card:hover .v-pick-subtle { border-color: var(--lime); color: var(--lime); }

.tools-with-dock { padding-bottom: 165px; }
.float-composer {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 35;
  width: min(920px, calc(100vw - 32px)); margin: 0;
  background: rgba(19,19,23,0.97); backdrop-filter: blur(18px);
  border: 1px solid rgba(209, 254, 23, 0.34); border-radius: 22px; padding: 14px 16px;
  box-shadow: 0 22px 60px rgba(0,0,0,0.82); display: flex; flex-direction: column; gap: 10px;
}
.photo-prompt-input {
  flex: 1; min-width: 140px; min-height: 40px; padding: 8px 12px;
  background: var(--canvas); border: 1px solid var(--border-str); border-radius: 12px;
  color: var(--text); font: inherit; font-size: 14px; outline: none;
}
.photo-prompt-input:focus { border-color: var(--lime); }
.v2-select {
  background: var(--surface); color: var(--text); border: 1px solid var(--border-str);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12px; font-weight: 600;
  outline: none; cursor: pointer;
}
.v2-select:focus { border-color: var(--lime); }
#photoMoreWrap[hidden] { display: none; }
.agent-shell { display: grid; grid-template-columns: 230px 1fr 340px; gap: 18px; min-height: calc(100vh - 150px); }
.lib-shell { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
.side-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 9px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; color: var(--sec); text-align: left; transition: .15s;
}
.side-link:hover { color: var(--text); background: var(--subtle); }
.side-link.active { background: var(--elevated); color: var(--text); border: 1px solid var(--border-str); }
.mcp-agents { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.mcp-agent-tab {
  padding: 8px 16px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--sec); transition: .15s;
}
.mcp-agent-tab.active { background: #fff; color: #09090B; border-color: #fff; font-weight: 700; }

/* Aurora Gradients for Pricing & Top-Up */
.promo-aurora {
  background: linear-gradient(115deg, #1E0718 0%, #7C154B 42%, #471464 76%, #130916 100%);
  background-size: 200% 200%;
  animation: shimmerFlow 9s ease infinite;
  border: 1px solid rgba(255, 77, 166, 0.55);
  box-shadow: 0 18px 50px rgba(196, 24, 114, 0.25);
}
.plan-card {
  position: relative; border-radius: 22px; padding: 14px;
  background: #111116; border: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
  transition: transform .2s, box-shadow .2s;
}
.plan-card:hover { transform: translateY(-3px); }
.plan-card.pro-glow {
  border: 1.5px solid rgba(255, 77, 166, 0.72);
  box-shadow: 0 16px 48px rgba(225, 29, 116, 0.22), inset 0 0 24px rgba(255, 77, 166, 0.08);
}
.plan-card.studio-glow {
  border: 1.5px solid rgba(99, 130, 255, 0.65);
  box-shadow: 0 16px 48px rgba(59, 91, 255, 0.2), inset 0 0 24px rgba(99, 130, 255, 0.08);
}
.plan-hero {
  border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
}
.plan-hero.starter-bg {
  background: linear-gradient(145deg, #272733 0%, #191923 55%, #121218 100%);
  border: 1px solid rgba(255,255,255,0.1);
}
.plan-hero.pro-bg {
  background: linear-gradient(135deg, #FF4D9E 0%, #D91B6A 42%, #7A1259 78%, #2E0924 100%);
  background-size: 200% 200%;
  animation: shimmerFlow 7s ease infinite;
  box-shadow: 0 12px 32px rgba(217, 27, 106, 0.35);
}
.plan-hero.studio-bg {
  background: linear-gradient(135deg, #74B9FF 0%, #4361EE 45%, #3A0CA3 82%, #190B3D 100%);
  background-size: 200% 200%;
  animation: shimmerFlow 8s ease infinite;
  box-shadow: 0 12px 32px rgba(67, 97, 238, 0.35);
}
.btn-white-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 11px 16px; border-radius: 12px; font-weight: 800; font-size: 13px;
  background: #FFFFFF; color: #09090B; box-shadow: 0 6px 20px rgba(0,0,0,0.28); transition: transform .15s;
}
.btn-white-pill:hover { transform: translateY(-1px); }
.pink-badge {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px;
  background: linear-gradient(90deg, #FF2E93, #E11D74); color: #fff; font-size: 10px; font-weight: 800;
}
.strike-red { color: #FF4D6D; text-decoration: line-through; font-weight: 700; }
.topup-pop {
  background: radial-gradient(ellipse at top, rgba(209, 254, 23, 0.28) 0%, rgba(25, 34, 15, 0.85) 45%, #131317 100%);
  border: 1.5px solid rgba(209, 254, 23, 0.72) !important;
  box-shadow: 0 14px 36px rgba(209, 254, 23, 0.14);
}
.topup-violet {
  background: radial-gradient(ellipse at top, rgba(168, 85, 247, 0.25) 0%, #161421 55%, #131317 100%);
  border: 1.5px solid rgba(192, 132, 252, 0.5) !important;
}

/* Clean 2-Column Video Workspace (Inspector opens as 3rd column on first result) */
.video-grid { display: grid; grid-template-columns: 400px 1fr; min-height: calc(100vh - 64px); }
.video-grid.has-result { grid-template-columns: 370px 1fr 320px; }
.v-sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px; display: flex; flex-direction: column; gap: 14px;
}
.v-prompt-card {
  background: var(--canvas); border: 1px solid var(--border-str); border-radius: 16px;
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s;
}
.v-prompt-card:focus-within { border-color: var(--lime); }
.v-prompt-textarea {
  width: 100%; min-height: 148px; background: none; border: none; color: var(--text);
  font: inherit; font-size: 14px; line-height: 1.55; resize: vertical; outline: none;
}
.v-prompt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border); }
.v-settings-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.v-settings-row .chip { padding: 7px 14px; font-size: 12px; }
.v-more-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-radius: 12px; background: var(--subtle); border: 1px solid var(--border);
  color: var(--sec); font-size: 12px; font-weight: 600; transition: border-color .15s, color .15s;
}
.v-more-toggle:hover { color: var(--text); border-color: var(--border-str); }
.v-more-box { display: flex; flex-direction: column; gap: 12px; }
.v-more-box[hidden], .v-inspector[hidden] { display: none; }
.v-inspector {
  background: var(--surface); border-left: 1px solid var(--border);
  padding: 18px; display: flex; flex-direction: column; gap: 14px;
}
.v-center {
  padding: 20px 24px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 18px; min-width: 0;
}
.v-presets-grid { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.preset-hero {
  position: relative; height: 102px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border-str);
}
.preset-hero img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.5); }
.preset-hero-body { position: absolute; inset: 10px; display: flex; flex-direction: column; justify-content: space-between; }
.mix-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mix-card {
  position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--lime);
  background: #0B0B0E; display: flex; flex-direction: column;
}
.mix-card-img { position: relative; height: 92px; }
.mix-card-img img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.58); }
.mix-card-title {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 6px; font-family: 'Unbounded', sans-serif; font-size: 10px; font-weight: 800; color: var(--lime);
  text-shadow: 0 2px 10px rgba(0,0,0,0.9);
}
.mix-card-del {
  position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 999px;
  background: rgba(9,9,11,0.85); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center;
}
.mix-slider-wrap { padding: 6px 8px; background: #14141A; display: flex; align-items: center; gap: 6px; }
.mix-slider-wrap input[type=range] { flex: 1; accent-color: var(--lime); height: 3px; }
.mix-slider-wrap span { font-size: 9px; color: var(--sec); min-width: 26px; text-align: right; }

/* Cinema Studio 4.0 Camera Setup Modal */
.cam-modal-body { display: grid; grid-template-columns: 150px 1fr; gap: 18px; min-height: 360px; }
.cam-nav { display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--border); padding-right: 14px; }
.cam-nav-btn {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px;
  font-size: 12px; font-weight: 600; color: var(--sec); text-align: left; transition: .15s;
}
.cam-nav-btn.active { background: var(--elevated); color: var(--text); border: 1px solid var(--border-str); }
.wheel-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.wheel-col { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.wheel-label { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--mut); }
.wheel-item {
  width: 100%; padding: 12px 10px; border-radius: 24px; text-align: center;
  background: var(--subtle); border: 1.5px solid var(--border); color: var(--sec);
  font-size: 11px; font-weight: 600; transition: .15s; cursor: pointer;
}
.wheel-item:hover { border-color: var(--border-str); color: var(--text); }
.wheel-item.active { background: #23232D; border-color: #fff; color: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,0.25); }
.move-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.move-card {
  position: relative; border-radius: 12px; overflow: hidden; border: 1.5px solid var(--border);
  background: #0C0C10; cursor: pointer; transition: .15s;
}
.move-card:hover { border-color: var(--lime); }
.move-card img { width: 100%; height: 92px; object-fit: cover; display: block; filter: brightness(0.75); }
.move-put {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--lime); color: var(--on-lime); font-size: 9px; font-weight: 800;
  padding: 4px 8px; border-radius: 999px; opacity: 0.92;
}
.move-name { padding: 6px; text-align: center; font-size: 11px; font-weight: 600; color: var(--text); }
.dropzone {
  background: var(--subtle); border: 1px dashed var(--border-str); border-radius: 14px;
  padding: 18px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; transition: .15s; text-align: center;
}
.dropzone:hover { border-color: var(--lime); background: #20202A; }
.ref-circles { display: flex; align-items: center; }
.ref-circle {
  width: 38px; height: 38px; border-radius: 999px; background: #252530; border: 1.2px solid #404052;
  display: flex; align-items: center; justify-content: center; margin-left: -6px; color: #F5F5F7;
}
.ref-circle:first-child { margin-left: 0; }
.selected-refs { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; justify-content: center; margin-top: 4px; }
.sel-ref-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 4px;
  border-radius: 999px; background: #09090B; border: 1px solid var(--lime); font-size: 10px; font-weight: 600; color: var(--lime);
}
.sel-ref-chip img { width: 20px; height: 20px; border-radius: 999px; object-fit: cover; }

.box-subtle { background: var(--subtle); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.player-frame {
  width: 356px; max-width: 100%; height: 590px; border-radius: 22px; overflow: hidden; position: relative;
  border: 1px solid var(--border-str); background: #050507; display: flex; flex-direction: column;
}
.player-frame img { flex: 1; width: 100%; object-fit: cover; min-height: 0; }
.sub-pill {
  position: absolute; bottom: 72px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: rgba(9,9,11,0.84); padding: 7px 14px; border-radius: 10px;
  font-family: 'Unbounded', sans-serif; font-size: 11px; font-weight: 700; color: var(--lime);
  max-width: 90%; overflow: hidden; text-overflow: ellipsis;
}
.player-bar { background: #0C0C10; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.p-track { height: 4px; border-radius: 99px; background: #2B2B36; overflow: hidden; }
.p-fill { width: 62%; height: 100%; background: var(--lime); }
.filmstrip { display: flex; gap: 10px; overflow-x: auto; max-width: 100%; }
.filmstrip img { width: 62px; height: 88px; border-radius: 10px; object-fit: cover; cursor: pointer; border: 2px solid transparent; opacity: 0.72; transition: .15s; flex-shrink: 0; }
.filmstrip img.active, .filmstrip img:hover { border-color: var(--lime); opacity: 1; }

/* Calendar Screen */
.cal-layout { display: grid; grid-template-columns: 1fr 420px; min-height: calc(100vh - 64px); }
.cal-main { padding: 22px 24px 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.soc-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.soc-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.soc-card.on { border-color: rgba(46,229,135,0.45); }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; flex: 1; }
.cal-days.week-view { gap: 10px; }
.day-col {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px;
  display: flex; flex-direction: column; gap: 8px; min-height: 122px; cursor: pointer; transition: .15s; min-width: 0;
}
.day-col:hover { border-color: var(--border-str); }
.day-col.selected-day { border-color: var(--lime); background: #171913; }
.day-num { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; }
.mini-slot {
  display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px;
  background: var(--subtle); border: 1px solid var(--border-str); font-size: 10px; min-width: 0;
}
.mini-slot.done { border-color: rgba(46,229,135,0.45); }
.mini-slot img { width: 22px; height: 28px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }
.slot-card {
  background: var(--subtle); border: 1px solid var(--border-str); border-radius: 12px; padding: 9px;
  display: flex; flex-direction: column; gap: 6px;
}
.slot-card.done { border-color: rgba(46,229,135,0.45); }
.slot-card img { width: 100%; height: 96px; object-fit: cover; border-radius: 8px; }
.cal-drawer {
  background: var(--surface); border-left: 1px solid var(--border); padding: 22px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
}
.vid-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.vp-item { cursor: pointer; text-align: center; }
.vp-thumb { position: relative; border-radius: 10px; overflow: hidden; border: 2px solid transparent; height: 112px; }
.vp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vp-item.selected .vp-thumb { border-color: var(--lime); }
.vp-check {
  display: none; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px;
  border-radius: 999px; background: var(--lime); color: var(--on-lime); align-items: center; justify-content: center;
}
.vp-item.selected .vp-check { display: flex; }

/* Panels & Grids */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px; min-width: 0; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* Modals */
.modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(5,5,7,0.82); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 740px; background: var(--surface); border: 1px solid var(--border-str);
  border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 16px;
  max-height: 90vh; overflow-y: auto;
}
.modal.modal-sm { max-width: 480px; }
.modal.modal-wide { max-width: min(1060px, 94vw); padding: 26px; }
.modal.modal-wide .media-grid { grid-template-columns: repeat(5, 1fr); gap: 14px; }
.modal.modal-wide .m-pick { height: 175px; }
.media-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.m-pick {
  position: relative; border-radius: 12px; overflow: hidden; height: 150px; cursor: pointer;
  border: 2px solid transparent; transition: .15s;
}
.m-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-pick.picked { border-color: var(--lime); }
.m-pick-tag {
  position: absolute; bottom: 6px; left: 6px; right: 6px; background: rgba(9,9,11,0.82);
  padding: 4px 8px; border-radius: 8px; font-size: 10px; font-weight: 600; color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}

/* Support Modal & Channels */
.support-list { display: flex; flex-direction: column; gap: 10px; }
.support-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--subtle); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
  transition: border-color .15s, background .15s;
}
.support-item:hover { border-color: var(--lime); background: #20202A; }
.support-item-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.support-icon {
  width: 36px; height: 36px; border-radius: 10px; background: var(--elevated);
  border: 1px solid var(--border-str); display: flex; align-items: center; justify-content: center; color: var(--lime); flex-shrink: 0;
}
.support-label { font-weight: 700; font-size: 13px; color: var(--text); }
.support-val { font-size: 11px; color: var(--sec); word-break: break-all; }

/* Auth inputs */
.v2-input {
  width: 100%; background: var(--canvas); border: 1px solid var(--border-str); border-radius: 12px;
  padding: 11px 13px; color: var(--text); font: inherit; font-size: 13px; outline: none;
}
.v2-input:focus { border-color: var(--lime); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border); background: rgba(13,13,17,0.92);
  padding: 18px 32px; margin-top: auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 12px; color: var(--sec);
}
.footer-links { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.footer-link { color: var(--sec); transition: color .15s; display: inline-flex; align-items: center; gap: 5px; }
.footer-link:hover { color: var(--lime); }

.asset-modal-grid { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  background: var(--lime); color: var(--on-lime); font-weight: 700; font-size: 12px;
  padding: 12px 18px; border-radius: 999px; box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  display: none; align-items: center; gap: 8px; max-width: calc(100vw - 32px);
}
.toast.show { display: flex; }

/* Responsive Breakpoints (Tablet 901–1260px & Mobile / iPhone 390px / Telegram Mini App) */
@media (max-width: 1260px) {
  .topnav { padding: 0 14px; gap: 8px; }
  .pill-new, .support-btn-label { display: none; }
  .nav-tab { padding: 6px 10px; font-size: 11px; }
  .btn-credits, .btn-ghost { padding: 6px 10px; font-size: 11px; }
  .quick-strip { grid-template-columns: repeat(3, 1fr); }
  .video-grid { grid-template-columns: 310px 1fr; }
  .v-inspector { grid-column: 1 / -1; border-left: none; border-top: 1px solid var(--border); }
  .agent-shell { grid-template-columns: 200px 1fr; }
  .agent-shell > div:last-child { grid-column: 1 / -1; }
  .suno-shell { grid-template-columns: 360px 1fr; }
  .cal-layout { grid-template-columns: 1fr; }
  .cal-drawer { border-left: none; border-top: 1px solid var(--border); }
}

@media (max-width: 1024px) {
  .topnav { height: 56px; padding: 0 10px; gap: 6px; }
  .brand-name { font-size: 15px; }
  .nav-tabs { gap: 2px; padding: 3px; }
  .nav-tab { padding: 5px 8px; font-size: 11px; gap: 4px; }
  .nav-tab .ic { width: 13px; height: 13px; }
  .btn-credits, .btn-ghost { padding: 5px 8px; font-size: 11px; }
  .btn-prof { padding: 3px 8px 3px 4px; font-size: 11px; gap: 5px; }
  .support-btn-label { display: none; }
}

@media (max-width: 760px) {
  .topnav { height: 54px; padding: 0 12px; gap: 8px; }
  .brand-name { font-size: 15px; }
  .nav-tabs, .pill-new, .btn-prof, .support-btn-label { display: none; }
  .mobile-tabbar {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: rgba(19,19,23,0.96); backdrop-filter: blur(16px);
    border-top: 1px solid var(--border); padding: 8px 8px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .screen { padding: 16px 14px 92px; }
  .screen.full-bleed { padding: 12px 14px 92px; }
  .tools-with-dock { padding-bottom: 225px; }
  .float-composer { bottom: 64px; width: calc(100vw - 20px); padding: 12px; border-radius: 18px; }
  .site-footer { padding: 14px 14px 86px; }
}

@media (max-width: 900px) {
  .btn-credits { padding: 6px 10px; font-size: 11px; }
  .btn-ghost { padding: 6px 9px; font-size: 11px; }
  .screen { padding: 14px 12px 92px; }
  .screen.full-bleed { padding: 12px 12px 92px; }
  .site-footer { padding: 14px 12px 86px; font-size: 11px; }
  .quick-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
  .q-tile { padding: 8px; gap: 8px; }
  .q-tile img { width: 36px; height: 36px; }
  .q-title { font-size: 11px; }
  .sec-title { font-size: 13px; }
  .masonry-4, .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .m-col { gap: 10px; }
  .grid-3 { grid-template-columns: 1fr; gap: 12px; }
  .video-grid, .video-grid.has-result { grid-template-columns: 1fr; gap: 14px; min-height: auto; }
  .v-sidebar, .v-inspector { border: 1px solid var(--border); border-radius: 18px; }
  .v-center { padding: 0; }
  .v-presets-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .player-frame { width: 100%; height: 420px; }
  .agent-shell, .lib-shell, .suno-shell { grid-template-columns: 1fr; }
  .suno-tracks-pane { position: static; }
  .suno-tracks-scroll { max-height: 460px; }
  .suno-studio-main { order: -1; }
  .suno-top-controls { grid-template-columns: 1fr; }
  .suno-hero-bar { padding: 16px; border-radius: 18px; }
  .suno-presets-grid { grid-template-columns: 1fr; }
  .suno-track-card { grid-template-columns: 56px 1fr; gap: 10px; padding: 12px; }
  .suno-track-cover { width: 56px; height: 56px; }
  .mtab { padding: 6px 4px; font-size: 9.5px; white-space: nowrap; }
  .cal-main { padding: 0; }
  .cal-drawer { border: 1px solid var(--border); border-radius: 18px; padding: 14px; }
  .soc-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cal-days { grid-template-columns: repeat(2, 1fr); }
  .vid-picker { grid-template-columns: repeat(2, 1fr); }
  .cam-modal-body { grid-template-columns: 1fr; }
  .cam-nav { border-right: none; border-bottom: 1px solid var(--border); padding: 0 0 10px; flex-direction: row; }
  .wheel-cols { grid-template-columns: 1fr; }
  .move-grid { grid-template-columns: repeat(2, 1fr); }
  .media-grid, .modal.modal-wide .media-grid { grid-template-columns: repeat(2, 1fr); }
  .asset-modal-grid { grid-template-columns: 1fr; }
  .toast { bottom: 78px; right: 12px; left: 12px; justify-content: center; }
  .mcp-hero-stage { padding: 22px 14px; }
}

/* MCP: живые подключения (GET/POST/DELETE /api/v2/mcp/tokens) */
.mcp-tokens-panel { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.mcp-tokens-hdr { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.mcp-tokens-sub { color: var(--sec); font-size: 12px; margin-top: 4px; }
.mcp-small-btn { padding: 8px 14px; font-size: 12px; }
.mcp-issued { border: 1px solid rgba(209, 254, 23, 0.45); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.mcp-issued[hidden] { display: none; }
.mcp-issued-warn { color: #D1FE17; font-size: 12px; font-weight: 600; }
.mcp-cmd { margin: 0; padding: 10px; border-radius: 8px; background: #09090B; border: 1px solid var(--border); font-size: 11px; white-space: pre-wrap; word-break: break-all; user-select: all; }
.mcp-issued-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mcp-tokens-list { display: flex; flex-direction: column; gap: 8px; }
.mcp-tokens-empty { color: var(--sec); font-size: 12px; padding: 10px 0; }
.mcp-token-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.mcp-token-name { font-weight: 700; font-size: 13px; }
.mcp-token-sub { color: var(--sec); font-size: 11px; margin-top: 2px; }

/* SEEDANCE 2.0 · Flagship 4x4 Hero Showcase Panel (Higgsfield-grade clean visual grid) */
.s20-hero-panel {
  border-radius: 24px;
  border: 1px solid rgba(209, 254, 23, 0.22);
  background: radial-gradient(ellipse at 20% 0%, rgba(209, 254, 23, 0.11) 0%, rgba(19, 19, 23, 0.96) 52%, #0B0B0E 100%);
  padding: 24px;
  margin-bottom: 34px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.s20-hero-top {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
  margin-bottom: 18px;
}
.s20-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 10px;
  background: rgba(209, 254, 23, 0.14); border: 1px solid rgba(209, 254, 23, 0.38);
  color: var(--lime); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.s20-title {
  font-family: 'Unbounded', sans-serif; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15;
  color: #fff;
}
.s20-title span { color: var(--lime); }
.s20-top-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--lime); color: #09090B;
  font-family: 'Unbounded', sans-serif; font-size: 10px; font-weight: 900;
  letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 0 0 18px rgba(209, 254, 23, 0.42);
}
.s20-sub { color: var(--sec); font-size: 13px; margin-top: 8px; max-width: 640px; }
.s20-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.s20-grid-16 {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start;
}
.s20-col {
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.s20-tile {
  position: relative; width: 100%; height: 280px; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1); background: #000; cursor: pointer;
  transition: transform .22s cubic-bezier(.22,1,.36,1), border-color .2s, box-shadow .22s;
}
.s20-tile.h-tall  { height: 360px; }
.s20-tile.h-med   { height: 280px; }
.s20-tile.h-short { height: 215px; }
.s20-tile:hover {
  transform: translateY(-3px); border-color: rgba(209, 254, 23, 0.8);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.68), 0 0 22px rgba(209, 254, 23, 0.18);
}
.s20-tile img, .s20-tile video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s cubic-bezier(.22,1,.36,1);
}
.s20-tile:hover img, .s20-tile:hover video { transform: scale(1.05); }
.s20-tile-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 10px;
  background: linear-gradient(180deg, rgba(9,9,11,0.12) 0%, transparent 45%, rgba(9,9,11,0.88) 100%);
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.s20-tile:hover .s20-tile-overlay, .s20-tile:focus-visible .s20-tile-overlay { opacity: 1; }
.s20-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.s20-badge {
  background: rgba(9,9,11,0.78); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.14); color: #fff;
  padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700;
}
.s20-live-dot {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: 0.04em;
  background: rgba(9, 9, 11, 0.72); border: 1px solid rgba(209, 254, 23, 0.5); color: var(--lime);
  backdrop-filter: blur(6px);
}
.s20-tile-name { font-family: 'Unbounded', sans-serif; font-size: 11px; font-weight: 700; color: #fff; line-height: 1.3; }
.s20-tile-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-size: 10px; color: #C4C4CC; }
.s20-tile-pill { background: var(--lime); color: var(--on-lime); font-weight: 800; padding: 3px 9px; border-radius: 999px; font-size: 10px; }

/* Showcase Video Detail Modal — Full-Screen Cinema Theater (1-in-1 Higgsfield layout) */
#showcaseDetailModal {
  padding: 0;
  background: rgba(5, 5, 7, 0.94);
  backdrop-filter: blur(18px);
}
.s20-modal-box {
  width: 100vw; height: 100vh; max-width: none; max-height: none; overflow: hidden;
  background: radial-gradient(circle at 38% 50%, #24262e 0%, #0d0e12 58%, #070709 100%);
  border: none; border-radius: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 390px; gap: 0;
}
.s20-modal-media {
  position: relative; width: 100%; height: 100vh; overflow: hidden; background: transparent;
  border: none; border-radius: 0; padding: 18px 22px;
  display: flex; align-items: center; justify-content: center;
}
.s20-modal-media.is-fill { padding: 0; }
.s20-modal-media video, .s20-modal-media img {
  width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 36px);
  object-fit: contain; display: block; border-radius: 14px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.78);
  background: #000;
}
.s20-modal-media video.s20-aspect-wide, .s20-modal-media img.s20-aspect-wide {
  width: 100%; height: auto;
}
.s20-modal-media video.s20-aspect-tall, .s20-modal-media img.s20-aspect-tall {
  height: calc(100vh - 36px); width: auto;
}
.s20-modal-media video.s20-fill-stage, .s20-modal-media img.s20-fill-stage {
  width: 100%; height: 100vh; max-height: 100vh; object-fit: cover; border-radius: 0; box-shadow: none;
}
.s20-fill-btn {
  position: absolute; top: 26px; left: 30px; z-index: 4;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: rgba(9, 9, 11, 0.72); border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff; font-size: 11px; font-weight: 700; backdrop-filter: blur(8px);
  transition: border-color .18s, color .18s, background .18s;
}
.s20-fill-btn:hover { border-color: var(--lime); color: var(--lime); }
.s20-fill-btn.active { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.s20-modal-info {
  height: 100vh; overflow-y: auto; padding: 22px 20px;
  background: rgba(16, 16, 20, 0.96); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.s20-modal-prompt {
  flex: 1; min-height: 160px; overflow-y: auto;
  padding: 14px; border-radius: 14px; background: #09090B; border: 1px solid var(--border);
  font-size: 12px; line-height: 1.55; color: #D4D4DC; white-space: pre-wrap;
}
.s20-modal-specs { display: flex; flex-wrap: wrap; gap: 8px; }
.s20-spec-chip {
  padding: 5px 10px; border-radius: 999px; background: var(--subtle); border: 1px solid var(--border);
  font-size: 11px; color: var(--sec); font-weight: 600;
}
@media (max-width: 900px) {
  .s20-hero-panel { padding: 14px; border-radius: 18px; margin-bottom: 22px; }
  .s20-title { font-size: 18px; }
  .s20-grid-16 { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .s20-col { gap: 8px; }
  .s20-tile.h-tall  { height: 245px; }
  .s20-tile.h-med   { height: 195px; }
  .s20-tile.h-short { height: 155px; }
  .s20-tile-overlay { opacity: 1; justify-content: flex-end; background: linear-gradient(180deg, transparent 48%, rgba(9,9,11,0.92) 100%); padding: 8px; }
  .s20-tile-top { display: none; }
  .s20-modal-box { grid-template-columns: 1fr; height: 100vh; overflow-y: auto; }
  .s20-modal-media { height: auto; min-height: 46vh; padding: 14px; }
  .s20-modal-media.is-fill { height: 74vh; min-height: 74vh; padding: 0; }
  .s20-modal-media video, .s20-modal-media img,
  .s20-modal-media video.s20-aspect-tall { max-height: 62vh; height: auto; width: 100%; object-fit: contain; }
  .s20-modal-media video.s20-fill-stage,
  .s20-modal-media img.s20-fill-stage { max-height: 74vh; height: 74vh; width: 100%; object-fit: cover; border-radius: 0; }
  .s20-fill-btn { top: 14px; left: 14px; display: inline-flex; }
  .s20-modal-info { height: auto; border-left: none; border-top: 1px solid var(--border); padding: 16px; }
}

/* GEO / FAQ footer on Explore (white-hat static HTML for humans & AI crawlers) */
.v2-geo-footer {
  margin-top: 28px; padding: 24px; border-radius: 20px;
  background: rgba(19, 19, 23, 0.72); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 16px;
}
.v2-geo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.v2-geo-lead { margin: 6px 0 0; max-width: 680px; color: var(--sec); font-size: 13px; line-height: 1.5; }
.v2-geo-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; }
.v2-geo-links a { color: var(--sec); text-decoration: none; border-bottom: 1px solid var(--border); padding-bottom: 2px; }
.v2-geo-links a:hover { color: var(--lime); border-color: var(--lime); }
.v2-geo-faq { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.v2-geo-faq details {
  background: rgba(9, 9, 11, 0.75); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; font-size: 12px; line-height: 1.5; color: var(--sec);
}
.v2-geo-faq summary { cursor: pointer; font-weight: 600; color: var(--text); list-style: none; }
.v2-geo-faq summary::-webkit-details-marker { display: none; }
.v2-geo-faq details p { margin: 8px 0 0; }
@media (max-width: 900px) { .v2-geo-faq { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════════════════════
   HIGGSFIELD-GRADE ERGONOMICS UPGRADE (MEGA-MENU · VIDEO · PHOTO · AGENT)
   ═══════════════════════════════════════════════════════════════════════ */

/* 1. Centered Floating Mega-Menu Dropdown */
.nav-mega-panel {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  width: min(820px, calc(100vw - 32px)); z-index: 95;
  background: rgba(17, 17, 21, 0.96); backdrop-filter: blur(22px);
  border: 1px solid var(--border-str); border-radius: 22px;
  padding: 18px; box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72);
  display: flex; flex-direction: column; gap: 16px;
}
.nav-mega-panel[hidden] { display: none !important; }
.mega-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mega-card {
  background: transparent; border: 1px solid transparent; border-radius: 14px; padding: 6px;
  text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s;
  display: flex; flex-direction: column; gap: 7px; color: var(--text);
}
.mega-card:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--border-str); }
.mega-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; display: block; }
.mega-card span { font-size: 12px; font-weight: 600; }
.mega-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 4px 6px; }
.mega-col-title { font-size: 11px; font-weight: 700; color: var(--mut); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.mega-list { display: flex; flex-direction: column; gap: 4px; }
.mega-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 10px; background: transparent; border: none;
  color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; text-align: left;
}
.mega-item:hover { background: rgba(255, 255, 255, 0.06); }
.mega-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.mega-badge.is-new { background: rgba(209, 254, 23, 0.16); color: var(--lime); }
.mega-badge.is-top { background: rgba(255, 77, 166, 0.18); color: #ff8bc5; }
.mega-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border); font-size: 12px; color: var(--sec);
}
.mega-banner strong { color: var(--text); }
.mega-banner button { background: none; border: none; color: var(--lime); font-weight: 700; cursor: pointer; font-size: 12px; white-space: nowrap; }

/* 2. Video Studio: 440px Left Rail + Pinned Sticky Bottom CTA + Live Canvas */
.video-grid { grid-template-columns: 440px 1fr; }
.video-grid.has-result { grid-template-columns: 440px 1fr 310px; }
.hf-v-sidebar {
  display: flex; flex-direction: column; padding: 0;
  height: calc(100vh - 64px); position: sticky; top: 64px;
  border-right: 1px solid var(--border); background: #0C0C0F;
}
.hf-v-scroll {
  flex: 1; overflow-y: auto; padding: 16px 18px 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.hf-v-sticky-cta {
  padding: 12px 18px 14px; border-top: 1px solid var(--border);
  background: rgba(12, 12, 15, 0.96); backdrop-filter: blur(12px);
}
.hf-v-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.hf-v-tab {
  background: none; border: none; color: var(--sec); font-size: 13px; font-weight: 600;
  padding: 0 0 8px; margin-bottom: -9px; cursor: pointer; border-bottom: 2px solid transparent;
}
.hf-v-tab.active { color: var(--text); border-bottom-color: var(--text); }
.hf-preset-banner {
  position: relative; height: 142px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border); background: #141418; flex-shrink: 0;
}
.hf-preset-banner img, .hf-preset-banner video { width: 100%; height: 100%; object-fit: cover; opacity: 0.86; display: block; }
.hf-preset-banner-scrim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9,9,11,0.9) 0%, rgba(9,9,11,0.25) 100%); }
.hf-preset-banner-info { position: absolute; left: 12px; bottom: 10px; z-index: 2; }
.hf-preset-banner-title { font-family: 'Unbounded', sans-serif; font-size: 15px; font-weight: 800; color: var(--lime); letter-spacing: 0.02em; }
.hf-preset-banner-sub { font-size: 11px; color: #D4D4D8; margin-top: 2px; }
.hf-preset-change {
  position: absolute; top: 8px; right: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.18);
  background: rgba(9, 9, 11, 0.75); color: var(--text); font-size: 11px; font-weight: 600; cursor: pointer;
}
.hf-preset-change:hover { border-color: var(--lime); color: var(--lime); }
.hf-seg-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: #141418; border: 1px solid var(--border); border-radius: 11px; padding: 3px;
}
.hf-seg-btn {
  background: transparent; border: none; border-radius: 8px; padding: 6px 8px;
  color: var(--sec); font-size: 12px; font-weight: 600; cursor: pointer;
}
.hf-seg-btn.active { background: #222229; color: var(--text); }
.hf-dropzone {
  width: 100%; padding: 14px 12px; border-radius: 14px;
  border: 1px dashed var(--border-str); background: rgba(255, 255, 255, 0.02);
  display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; color: var(--text);
}
.hf-dropzone:hover { border-color: var(--lime); background: rgba(209, 254, 23, 0.04); }
.hf-dropzone strong { font-size: 12px; font-weight: 700; }
.hf-dropzone span { font-size: 11px; color: var(--sec); }
.hf-dropzone-icons { display: flex; align-items: center; margin-bottom: 4px; }
.hf-dropzone-icons span {
  width: 28px; height: 28px; border-radius: 999px; background: #1C1C22; border: 1px solid var(--border-str);
  display: inline-flex; align-items: center; justify-content: center; margin-left: -6px; color: #D4D4D8;
}
.hf-dropzone-icons span:first-child { margin-left: 0; }
.hf-field-label { font-size: 11px; font-weight: 600; color: var(--sec); display: block; margin-bottom: 4px; }
.hf-prompt-card { background: #141418; border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; }
.hf-params-block { display: flex; flex-direction: column; gap: 8px; }
.hf-model-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 12px; background: #141418; border: 1px solid var(--border);
  color: var(--text); cursor: pointer; text-align: left;
}
.hf-model-row:hover, .hf-param-tile:hover { border-color: var(--border-str); }
.hf-param-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hf-param-tile {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 9px 12px; border-radius: 12px; background: #141418; border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
}
.hf-tile-valrow { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.hf-tab-pill {
  font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 999px;
  background: rgba(209, 254, 23, 0.16); color: var(--lime); margin-left: 4px; vertical-align: middle;
}
.hf-voiced-box {
  background: linear-gradient(180deg, rgba(209, 254, 23, 0.06) 0%, rgba(20, 20, 24, 0.95) 100%);
  border: 1px solid rgba(209, 254, 23, 0.28); border-radius: 14px; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.hf-voiced-box[hidden] { display: none !important; }
.hf-voiced-head { display: flex; flex-direction: column; gap: 2px; }
.hf-voiced-head strong { font-size: 12px; color: var(--lime); }
.hf-voiced-head span { font-size: 11px; color: var(--sec); }
.hf-mini-group { display: flex; flex-direction: column; gap: 5px; }

/* Higgsfield-style Parameter Popovers (Model / Duration / Aspect Ratio) */
.hf-pop-anchor { position: relative; }
.hf-popover {
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 80;
  min-width: 180px; width: 100%;
  background: rgba(18, 18, 22, 0.98); backdrop-filter: blur(22px);
  border: 1px solid var(--border-str); border-radius: 16px; padding: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.78);
  display: flex; flex-direction: column; gap: 6px;
}
.hf-popover[hidden] { display: none !important; }
.hf-pop-right { left: auto; right: 0; min-width: 190px; }
.hf-model-pop { width: 404px; max-width: calc(100vw - 32px); max-height: 440px; }
.hf-popover.suno-genre-pop { top: calc(100% + 8px); bottom: auto; width: min(380px, 92vw); }
.hf-pop-search {
  width: 100%; background: #0C0C0F; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 10px; color: var(--text); font-size: 12px; outline: none;
}
.hf-pop-search:focus { border-color: var(--lime); }
.hf-pop-list { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; max-height: 330px; }
.hf-pop-sec {
  font-size: 10px; font-weight: 700; color: var(--mut); text-transform: uppercase;
  letter-spacing: 0.06em; padding: 6px 8px 2px;
}
.hf-pop-opt {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 10px; background: transparent; border: 1px solid transparent;
  color: var(--text); text-align: left; cursor: pointer; font-size: 12px;
}
.hf-pop-opt:hover { background: rgba(255, 255, 255, 0.06); }
.hf-pop-opt.active { background: rgba(209, 254, 23, 0.10); border-color: rgba(209, 254, 23, 0.38); }
.hf-pop-opt.is-top-glow { background: rgba(255, 77, 166, 0.06); border-color: rgba(255, 77, 166, 0.22); }
.hf-pop-opt.is-top-glow.active { background: rgba(209, 254, 23, 0.12); border-color: rgba(209, 254, 23, 0.48); }
.hf-pop-opt:disabled { opacity: 0.42; cursor: not-allowed; }
.hf-pop-opt-sub { font-size: 10px; color: var(--sec); margin-top: 2px; display: block; }
.hf-ratio-box {
  display: inline-block; border: 1.5px solid currentColor; border-radius: 2px; flex-shrink: 0; opacity: 0.85;
}
.v-card-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.v-card:hover .v-card-video { opacity: 1; }
.hf-param-k { font-size: 10px; color: var(--sec); display: block; }
.hf-param-v { font-size: 13px; font-weight: 700; color: var(--text); }
.hf-v-canvas { padding: 14px 20px 28px; justify-content: flex-start !important; align-items: stretch !important; }
.v-card img[src*="shorts_creator"] { object-position: center 18%; }
.hf-canvas-topbar {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}

/* 3. Photo Screen: Edge-to-Edge Borderless Gallery + Floating Glass Composer */
.hf-photo-screen { padding: 12px 12px 175px; }
.photo-avatar-create {
  border-style: dashed; border-color: rgba(209, 254, 23, 0.55); color: var(--lime);
  background: rgba(209, 254, 23, 0.08); font-weight: 700;
}
.photo-avatar-create:hover { border-color: var(--lime); background: rgba(209, 254, 23, 0.16); color: #fff; }
.photo-avatars-strip { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.photo-avatar-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px;
}
.photo-avatar-chip img {
  width: 20px; height: 20px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border-str); display: block;
}
.photo-avatar-chip.active {
  border-color: var(--lime); background: rgba(209, 254, 23, 0.18); color: #fff;
}
.avatar-file-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--text); cursor: pointer;
}
.avatar-file-row input[type="file"] { font-size: 11px; color: var(--sec); max-width: 220px; }
.hf-photo-topbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 12px 4px;
}
.hf-photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.hf-photo-card {
  height: 310px; border-radius: 10px; border: none !important; overflow: hidden; position: relative;
}
.hf-photo-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.hf-photo-card:hover img { transform: scale(1.03); }
.hf-photo-hover {
  position: absolute; inset: auto 0 0 0; padding: 28px 12px 12px;
  background: linear-gradient(180deg, transparent 0%, rgba(9, 9, 11, 0.88) 100%);
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; transition: opacity 0.18s ease;
}
.hf-photo-card:hover .hf-photo-hover { opacity: 1; }
.hf-float-dock {
  max-width: 880px; width: min(880px, calc(100vw - 28px));
  background: rgba(24, 24, 29, 0.92); backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 22px;
  padding: 12px 14px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72);
}
.hf-dock-main { display: flex; gap: 12px; align-items: stretch; }
.hf-dock-left { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hf-dock-input {
  width: 100%; background: transparent !important; border: none !important;
  padding: 4px 2px !important; font-size: 14px !important; color: var(--text); outline: none;
  min-height: 44px; max-height: 128px; line-height: 1.4; resize: none; font-family: inherit;
}
.hf-dock-pills { gap: 6px; }
.hf-dock-cta {
  padding: 0 22px; border-radius: 14px; font-size: 13px; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
}

/* 4. Agent Screen: Supercomputer Clean Centered Layout + Slide-In Results Drawer */
.hf-agent-shell {
  display: grid; grid-template-columns: 236px 1fr; gap: 0;
  min-height: calc(100vh - 64px);
}
.hf-agent-shell.has-results { grid-template-columns: 236px 1fr 340px; }
.hf-agent-rail {
  border-right: 1px solid var(--border); background: #0B0B0E; padding: 14px 12px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
}
.hf-rail-new {
  width: 100%; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 10px; background: #18181D; border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; margin-bottom: 6px;
}
.hf-rail-new:hover { border-color: var(--lime); }
.hf-rail-label { font-size: 10px; font-weight: 700; color: var(--mut); margin: 12px 0 4px 10px; letter-spacing: 0.06em; }
.hf-rail-foot { padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.hf-agent-stage { display: flex; flex-direction: column; min-width: 0; padding: 14px 24px 28px; }
.hf-agent-topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.hf-agent-center {
  width: min(740px, 100%); margin: auto; display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 24px 0 36px;
}
.hf-agent-hero { display: flex; align-items: center; gap: 12px; justify-content: center; text-align: center; }
.hf-agent-mark { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.hf-agent-h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.hf-agent-composer {
  width: 100%; background: #16161B; border: 1px solid var(--border-str); border-radius: 20px;
  padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.hf-agent-input {
  width: 100%; background: transparent; border: none; color: var(--text); outline: none; font-size: 14px;
  min-height: 68px; max-height: 180px; line-height: 1.45; resize: none; font-family: inherit;
}
.hf-agent-composer-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.hf-agent-send {
  width: 34px; height: 34px; border-radius: 10px; border: none; background: var(--lime); color: #09090B;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.hf-agent-subbar {
  width: 100%; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 0 4px;
}
.hf-ghost-link {
  background: none; border: none; color: var(--sec); font-size: 12px; font-weight: 500; cursor: pointer; padding: 4px 6px;
}
.hf-ghost-link:hover { color: var(--text); }
.hf-agent-modes { justify-content: center; }
.hf-agent-log { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.hf-agent-results {
  border-left: 1px solid var(--border); background: #0C0C0F; padding: 16px;
  display: flex; flex-direction: column; gap: 12px; overflow-y: auto;
}
.hf-agent-results[hidden] { display: none !important; }

@media (max-width: 900px) {
  .nav-mega-panel { display: none !important; }
  .hf-v-sidebar { height: auto; position: static; border-right: none; width: 100%; min-width: 0; }
  .video-grid, .video-grid.has-result { grid-template-columns: minmax(0, 1fr); }
  .hf-v-scroll { padding: 12px 14px 14px; }
  .hf-v-sticky-cta { padding: 10px 14px 12px; }
  .hf-model-pop { width: min(358px, calc(100vw - 28px)); }
  .hf-preset-banner { height: 118px; }
  .hf-v-scroll { overflow: visible; padding: 12px; }
  .hf-v-sticky-cta { position: sticky; bottom: 58px; z-index: 15; }
  .hf-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hf-photo-card { height: 220px; }
  .hf-photo-hover { opacity: 1; }
  .hf-dock-main { flex-direction: column; }
  .hf-dock-cta { padding: 11px 16px; width: 100%; }
  .hf-agent-shell, .hf-agent-shell.has-results { grid-template-columns: 1fr; min-height: auto; }
  .hf-agent-rail { border-right: none; border-bottom: 1px solid var(--border); }
  .hf-agent-h1 { font-size: 20px; }
  .hf-agent-results { border-left: none; border-top: 1px solid var(--border); }
}



/* ── АГЕНТ 2.0: живой чат, карточки генерации, Моя Библиотека, выдвижная панель (Dark Cinema) ── */
.ag-shell {
  display: grid; grid-template-columns: 236px minmax(0, 1fr) 320px; gap: 0;
  height: calc(100vh - 64px); height: calc(100dvh - 64px); min-height: 520px;
}
.ag-rail {
  border-right: 1px solid var(--border); background: #0B0B0E; padding: 14px 12px; min-height: 0;
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
}
.ag-rail-top { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ag-chat-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }
.ag-chat-item { display: flex; align-items: center; gap: 2px; border-radius: 10px; border: 1px solid transparent; }
.ag-chat-item:hover { background: var(--subtle); }
.ag-chat-item.active { background: var(--elevated); border-color: var(--border-str); }
.ag-chat-open {
  flex: 1; min-width: 0; text-align: left; background: none; border: none; color: var(--sec); cursor: pointer;
  padding: 8px 10px; font-size: 12px; font-family: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ag-chat-item.active .ag-chat-open { color: var(--text); font-weight: 600; }
.ag-chat-del {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; background: none; border: none; color: var(--mut);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; opacity: 0;
}
.ag-chat-item:hover .ag-chat-del, .ag-chat-item.active .ag-chat-del, .ag-chat-del:focus-visible { opacity: 1; }
.ag-chat-del:hover { color: var(--danger); background: rgba(255, 77, 109, 0.1); }
.ag-chat-del .ic { width: 13px; height: 13px; }
.ag-chat-empty { color: var(--mut); font-size: 11px; padding: 6px 10px; line-height: 1.4; }
.ag-balance-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--sec); }
.ag-balance-row strong { color: var(--text); font-size: 13px; }
.ag-safe-title { color: var(--lime); font-weight: 700; font-size: 11px; }
.ag-safe-sub { color: var(--sec); font-size: 11px; line-height: 1.4; }
.ag-topup-link { text-align: left; padding: 2px 0; color: var(--lime); }

.ag-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 12px 22px 16px; gap: 10px; }
.ag-topbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ag-model { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: var(--mut); font-weight: 600; }
.ag-select {
  appearance: none; -webkit-appearance: none; background: #16161B; color: var(--text); border: 1px solid var(--border-str);
  border-radius: 10px; padding: 8px 30px 8px 12px; font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer;
  max-width: 100%; min-width: 0;
  background-image: linear-gradient(45deg, transparent 50%, #B2B2BE 50%), linear-gradient(135deg, #B2B2BE 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.ag-select:hover, .ag-select:focus-visible { border-color: var(--lime); outline: none; }
.ag-base-chip { cursor: default; color: var(--lime); border-color: rgba(209, 254, 23, 0.35); font-size: 11px; gap: 6px; display: inline-flex; align-items: center; }
.ag-base-chip .ic { width: 13px; height: 13px; }
.ag-lib-toggle { display: none; margin-left: auto; }

.ag-log {
  flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  padding: 6px 4px 10px; scroll-behavior: smooth; overscroll-behavior: contain;
}
.ag-empty { margin: auto; width: min(620px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 18px 0; }
.ag-empty-mark { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.ag-empty-title { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.ag-empty-sub { color: var(--sec); font-size: 13px; line-height: 1.5; max-width: 480px; }
.ag-starters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ag-starter {
  background: #16161B; border: 1px solid var(--border-str); color: var(--text); border-radius: 999px; padding: 9px 14px;
  font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.ag-starter:hover { border-color: var(--lime); color: var(--lime); }

.ag-msg { display: flex; flex-direction: column; gap: 8px; max-width: min(760px, 100%); width: 100%; margin: 0 auto; }
.ag-msg-user { align-items: flex-end; }
.ag-bubble { border-radius: 16px; padding: 11px 14px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.ag-msg-user .ag-bubble { background: var(--elevated); border: 1px solid var(--border-str); max-width: 86%; border-bottom-right-radius: 6px; }
.ag-msg-bot .ag-bubble { background: transparent; padding: 2px 2px; }
.ag-msg-meta { font-size: 10px; color: var(--mut); font-weight: 600; letter-spacing: 0.04em; display: flex; gap: 8px; align-items: center; }
.ag-msg-meta .ag-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.ag-msg-err .ag-bubble { background: rgba(255, 77, 109, 0.08); border: 1px solid rgba(255, 77, 109, 0.4); color: #FFC2CD; font-size: 13px; }
.ag-msg-thumbs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ag-msg-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border-str); }
.ag-typing { display: inline-flex; gap: 5px; align-items: center; padding: 8px 2px; }
.ag-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); opacity: 0.35; animation: agBlink 1.2s infinite ease-in-out; }
.ag-typing span:nth-child(2) { animation-delay: 0.2s; }
.ag-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes agBlink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.ag-card {
  background: var(--surface); border: 1px solid var(--border-str); border-radius: 16px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.ag-card.is-done { border-color: rgba(209, 254, 23, 0.45); }
.ag-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ag-card-title { font-family: 'Unbounded', sans-serif; font-size: 12px; font-weight: 700; line-height: 1.35; }
.ag-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ag-card-tag { font-size: 10px; font-weight: 600; color: var(--sec); background: var(--subtle); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }
.ag-card-price { flex-shrink: 0; font-size: 12px; font-weight: 800; color: var(--on-lime); background: var(--lime); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.ag-card-prompt { background: #0E0E12; border: 1px solid var(--border); border-radius: 12px; font-size: 12px; color: var(--sec); line-height: 1.5; }
.ag-card-prompt summary { cursor: pointer; padding: 8px 12px; font-weight: 600; color: var(--text); font-size: 11px; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
.ag-card-prompt summary::-webkit-details-marker { display: none; }
.ag-card-prompt summary::after { content: '+'; color: var(--mut); font-weight: 700; }
.ag-card-prompt[open] summary::after { content: '−'; }
.ag-card-prompt-body { padding: 0 12px 10px; overflow-wrap: anywhere; white-space: pre-wrap; }
.ag-card-refs { display: flex; gap: 6px; }
.ag-card-refs img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border-str); }
.ag-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ag-card-actions .btn-lime, .ag-card-actions .btn-dark { padding: 9px 14px; font-size: 12px; }
.ag-card-actions a { text-decoration: none; display: inline-flex; align-items: center; }
.ag-run { display: flex; flex-direction: column; gap: 8px; }
.ag-run-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12px; color: var(--sec); }
.ag-run-pct { font-family: 'Unbounded', sans-serif; font-size: 16px; font-weight: 800; color: var(--lime); }
.ag-run-bar { height: 6px; border-radius: 999px; background: var(--subtle); overflow: hidden; }
.ag-run-fill { height: 100%; width: 0; border-radius: 999px; background: var(--lime); transition: width 0.9s linear; }
.ag-run-note { font-size: 11px; color: var(--mut); }
.ag-run-err { font-size: 12px; color: #FFC2CD; background: rgba(255, 77, 109, 0.08); border: 1px solid rgba(255, 77, 109, 0.4); border-radius: 10px; padding: 8px 10px; }
.ag-result { display: flex; flex-direction: column; gap: 10px; }
.ag-result-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ag-result-media img, .ag-result-media video { width: 100%; max-height: 420px; border-radius: 12px; background: #000; object-fit: contain; border: 1px solid var(--border); display: block; }
.ag-result-media.is-single { grid-template-columns: minmax(0, 320px); }
.ag-track { display: flex; flex-direction: column; gap: 6px; background: #0E0E12; border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.ag-track-title { font-size: 12px; font-weight: 600; }
.ag-track audio { width: 100%; height: 36px; }

.ag-composer {
  width: min(760px, 100%); margin: 0 auto; background: #16161B; border: 1px solid var(--border-str); border-radius: 18px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4); flex-shrink: 0;
}
.ag-composer:focus-within { border-color: rgba(209, 254, 23, 0.55); }
.ag-input {
  width: 100%; background: transparent; border: none; color: var(--text); outline: none; font-size: 14px;
  min-height: 44px; max-height: 200px; line-height: 1.45; resize: none; font-family: inherit; padding: 4px 2px;
}
.ag-composer-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ag-composer-bar .chip { padding: 6px 11px; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.ag-send { padding: 9px 16px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.ag-send .ic { width: 14px; height: 14px; }
.ag-send[disabled] { opacity: 0.55; cursor: progress; }
.ag-attach-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ag-attach-row[hidden] { display: none; }
.ag-attach { position: relative; width: 52px; height: 52px; }
.ag-attach img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid var(--border-str); }
.ag-attach button {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border-str);
  background: #09090B; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.ag-attach button .ic { width: 10px; height: 10px; }

.ag-lib { border-left: 1px solid var(--border); background: #0C0C0F; padding: 14px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.ag-lib-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ag-lib-title { font-size: 12px; margin: 0; }
.ag-lib-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow-y: auto; min-height: 0; align-content: start; }
.ag-lib-empty { grid-column: 1 / -1; color: var(--mut); font-size: 12px; line-height: 1.5; padding: 10px 2px; }
.ag-lib-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.ag-lib-thumb { aspect-ratio: 3 / 4; background: #000; display: flex; align-items: center; justify-content: center; color: var(--lime); }
.ag-lib-thumb img, .ag-lib-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ag-lib-thumb .ic { width: 28px; height: 28px; }
.ag-lib-item.is-audio { grid-column: 1 / -1; }
.ag-lib-item.is-audio .ag-lib-thumb { aspect-ratio: auto; padding: 8px; background: #0E0E12; }
.ag-lib-item.is-audio audio { width: 100%; height: 34px; }
.ag-lib-meta { padding: 6px 8px 0; font-size: 10px; color: var(--sec); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-lib-actions { display: flex; gap: 4px; padding: 6px; }
.ag-lib-actions a, .ag-lib-actions button {
  flex: 1; text-align: center; font-size: 10px; font-weight: 700; padding: 6px 4px; border-radius: 8px; cursor: pointer;
  background: var(--subtle); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-family: inherit;
}
.ag-lib-actions a:hover, .ag-lib-actions button:hover { border-color: var(--lime); color: var(--lime); }
.ag-pick { position: relative; }
.ag-pick.picked { outline: 2px solid var(--lime); outline-offset: -2px; }

.ag-open-btn { display: inline-flex; align-items: center; gap: 5px; color: var(--lime); border-color: rgba(209, 254, 23, 0.4); }
.ag-open-btn .ic { width: 12px; height: 12px; }
.ag-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100%; z-index: 96;
  background: #0C0C0F; border-left: 1px solid var(--border-str); box-shadow: -24px 0 60px rgba(0, 0, 0, 0.55);
  display: flex; flex-direction: column; gap: 10px; padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  animation: agSlide 0.22s ease-out;
}
.ag-drawer[hidden] { display: none; }
@keyframes agSlide { from { transform: translateX(36px); } to { transform: translateX(0); } }
.ag-drawer-head { display: flex; align-items: center; gap: 8px; }
.ag-drawer-head .ag-select { flex: 1; }
.ag-drawer-head .chip { padding: 7px 9px; display: inline-flex; }
.ag-drawer-title { font-size: 12px; font-weight: 800; color: var(--lime); white-space: nowrap; }
.ag-drawer .ag-empty-title { font-size: 17px; }
.ag-drawer .ag-result-media.is-single { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 1180px) {
  .ag-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .ag-lib-toggle { display: inline-flex; }
  .ag-lib { display: none; position: fixed; top: 64px; right: 0; bottom: 0; width: min(340px, 100%); z-index: 60; box-shadow: -24px 0 60px rgba(0, 0, 0, 0.55); }
  .ag-shell.lib-open .ag-lib { display: flex; }
}
@media (max-width: 900px) {
  .ag-shell { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .ag-rail { border-right: none; border-bottom: 1px solid var(--border); padding: 10px 12px; gap: 8px; }
  .ag-rail-top { flex-direction: row; align-items: center; gap: 8px; }
  .ag-rail .hf-rail-new { width: auto; margin: 0; flex-shrink: 0; padding: 8px 10px; }
  .ag-rail .hf-rail-label, .ag-rail .hf-rail-foot { display: none; }
  .ag-chat-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; flex: 1; }
  .ag-chat-item { flex-shrink: 0; max-width: 170px; }
  .ag-chat-del { opacity: 1; }
  .ag-stage { padding: 10px 12px 12px; height: calc(100dvh - 222px - env(safe-area-inset-bottom, 0px)); min-height: 400px; }
  .ag-empty-title { font-size: 19px; }
  .ag-msg-user .ag-bubble { max-width: 94%; }
  .ag-lib { top: 0; z-index: 97; }
  .ag-drawer { width: 100%; border-left: none; }
  .ag-send span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ag-drawer, .ag-typing span { animation: none; }
  .ag-run-fill { transition: none; }
}
