:root {
  --bg: #0b0b0f;
  --card: #1a1a22;
  --text: #f6f7fb;
  --muted: #8b8d98;
  --primary: #6366f1;
  --accent: #6ce5b1;
  --danger: #ff5c7a;
  --gold: #ffd146;
  --orange: #ff6b35;
  --xl: 1280px;
}

* { box-sizing: border-box; }
html, body { 
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Ubuntu, Inter, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

#app { min-height: 100dvh; }

/* Page wrapper для корректного layout с Footer */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding-bottom: 0;
}

.container { padding: 16px; }
.container-xl { padding: 16px; max-width: var(--xl); margin: 0 auto; }
.row { display: flex; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3-desktop { grid-template-columns: repeat(2, 1fr); }

.banner {
  position: relative; border-radius: 20px; overflow: hidden; height: 200px;
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%); margin: 16px 16px 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.banner video, .banner img { width: 100%; height: 100%; object-fit: cover; display:block; }
.banner .banner-content { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: flex-start; z-index: 2; }
.banner .banner-brand { font-size: 20px; font-weight: 900; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.4); font-style: italic; }
.banner .banner-promo { display: flex; gap: 8px; }
.banner .banner-icons { display: flex; gap: 8px; }
.banner .banner-icon { background: rgba(255,255,255,.25); backdrop-filter: blur(8px); padding: 8px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; color: #fff; }
.banner .banner-icon.pro-badge { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); }
.banner .banner-cta { position: absolute; right: 16px; bottom: 16px; background: #fff; color: #1a1a1a; padding: 12px 24px; border-radius: 24px; font-weight: 700; font-size: 14px; border: none; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.2); transition: transform 0.2s; z-index: 2; }
.banner .banner-cta:hover { transform: scale(1.05); }
.banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,.6) 100%); z-index: 1; }

.section-header { display:flex; align-items:center; justify-content:space-between; padding: 20px 16px 12px; }
.section-header h2 { margin: 0; font-size: 20px; font-weight: 800; }
.see-all { color: var(--muted); font-size: 14px; text-decoration: none; font-weight: 600; }
.see-all:hover { color: var(--text); }

.h-scroll { display:flex; gap: 14px; overflow-x:auto; padding: 0 16px 16px; scroll-snap-type: x mandatory; }
.h-scroll::-webkit-scrollbar { display:none; }
.h-scroll > * { scroll-snap-align: start; }

.card {
  position:relative; min-width: 160px; width: 160px; height: 220px; border-radius: 16px; overflow: hidden; background: var(--card);
  box-shadow: 0 2px 12px rgba(0,0,0,.2); transition: transform 0.2s;
}
.card:hover { transform: translateY(-4px); }
.card img, .card video { width: 100%; height: 100%; object-fit: cover; display:block; }
.card .card-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 12px; background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.8) 100%); display: flex; align-items: center; gap: 10px; }
.card .card-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; border: 2px solid #fff; flex-shrink: 0; }
.card .card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.card .card-title { font-weight: 700; font-size: 13px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.chip { position:absolute; right:8px; top:8px; background: rgba(0,0,0,.7); backdrop-filter: blur(8px); color: #fff; padding: 6px 10px; border-radius: 14px; font-size: 11px; display:flex; gap:6px; align-items:center; }
.chip .price { color: var(--gold); font-weight:700; }

/* Effect Card - точный стиль higgsfield */
.effect-card-wrapper {
  position: relative;
  padding: 4px;
  width: 100%;
  height: 100%;
}

.effect-card-inner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  z-index: 0;
  transition: filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
}

.effect-card-wrapper:hover .effect-card-inner {
  filter: brightness(0.3);
}

.effect-card-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.effect-card-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  padding: 16px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: linear-gradient(180deg, rgba(0,0,0,.3) 0%, transparent 50%, transparent 100%);
}

@media (min-width: 768px) {
  .effect-card-overlay {
    padding: 20px;
    background: linear-gradient(180deg, transparent 0%, transparent 50%, rgba(0,0,0,.3) 100%);
  }
}

.effect-card-title {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: auto;
}

@media (min-width: 768px) {
  .effect-card-title {
    text-align: center;
    font-size: 16px;
    margin-bottom: 0;
    justify-content: center;
  }
}

@media (min-width: 1024px) {
  .effect-card-title {
    font-size: 18px;
    line-height: 1.75;
  }
}

.effect-card-generate-btn {
  opacity: 1;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(209, 254, 23, 0.2);
  border-radius: 12px;
  height: 40px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(209, 254, 23, 0.05);
  color: rgb(209, 254, 23);
  cursor: pointer;
  pointer-events: auto;
  display: grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  margin-top: auto;
}

@media (min-width: 768px) {
  .effect-card-generate-btn {
    opacity: 0;
  }
  
  .effect-card-wrapper:hover .effect-card-generate-btn {
    opacity: 1;
  }
}

.effect-card-generate-btn:hover {
  background: rgba(209, 254, 23, 0.1);
}

.effect-card-generate-btn:active {
  background: rgba(209, 254, 23, 0.15);
}

.floating-cta { position: sticky; left: 0; right: 0; bottom: 80px; margin: 0 16px; display:flex; justify-content:center; }
.floating-cta .btn-primary { filter: drop-shadow(0 8px 24px rgba(91,124,250,.4)); }

.watermark { position:absolute; right:10px; bottom:10px; background: rgba(0,0,0,.5); color:#fff; padding:4px 8px; border-radius:6px; font-size:12px; }

.toolbar { position: fixed; left: 0; right: 0; bottom: 0; height: 68px; display:flex; background: rgba(11,11,15,.98); backdrop-filter: blur(12px); border-top: 1px solid rgba(255,255,255,0.08); z-index: 100; }
.toolbar a { flex:1; display:flex; flex-direction: column; align-items:center; justify-content:center; gap:4px; color: var(--muted); text-decoration:none; font-weight:600; font-size: 12px; transition: color 0.2s; }
.toolbar a.active { color: var(--orange); }
.toolbar .center { position: relative; }
.toolbar .center .fab { position:absolute; top:-28px; width:60px; height:60px; border-radius:50%; background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%); color:#fff; display:flex; align-items:center; justify-content:center; font-size:28px; font-weight:800; box-shadow: 0 8px 32px rgba(99,102,241,.5); border: 4px solid var(--bg); }

.titlebar { display:flex; align-items:center; justify-content:space-between; padding: 14px 16px 6px; }
.titlebar h1 { margin:0; font-size: 22px; }
.pro { background: #2440ff; color:#fff; padding:6px 10px; border-radius: 14px; font-weight:700; font-size: 12px; }

.btn-primary, .btn, .btn-outline {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-weight:700; padding: 14px 20px; border-radius: 14px; text-decoration:none; border: none; cursor:pointer;
  transition: all 0.2s; font-size: 15px;
}
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%); color:#fff; box-shadow: 0 4px 16px rgba(99,102,241,.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,.4); }
.btn-outline { border:1px solid rgba(255,255,255,.15); color:#fff; background: transparent; }
.btn-outline:hover { background: rgba(255,255,255,.05); }
.btn { background: #2b2c36; color:#fff; }
.btn:hover { background: #35364a; }

.muted { color: var(--muted); }
.price { color: var(--gold); font-weight: 800; }
.divider { height:1px; background: rgba(255,255,255,.06); margin: 8px 16px; }

.input, .select, .file {
  width:100%; background: #1a1a22; border: 1px solid rgba(255,255,255,.08); color:#fff;
  padding: 12px 14px; border-radius: 12px; outline: none; font-size: 16px;
}
.field { display:flex; flex-direction:column; gap:8px; margin-bottom: 12px; }

.pill { display:inline-flex; align-items:center; gap:6px; background:#1d1e27; padding:6px 10px; border-radius:999px; font-size:12px; }

.result-video { position:relative; border-radius: 16px; overflow:hidden; background:#111; }
.share-row { display:flex; gap:8px; flex-wrap:wrap; }

.notice { background: #14202a; color:#d0efff; border: 1px solid #203040; padding: 10px 12px; border-radius: 10px; font-size: 14px; }

.timer { font-variant-numeric: tabular-nums; }
.section-title-xl { font-size: 42px; font-weight: 900; margin: 16px 0 12px; color: #c4ffc1; }
.pro-cta { background:#2440ff; color:#fff; padding:6px 10px; border-radius:14px; font-weight:700; text-decoration:none; }

.filter-row { display:flex; gap:8px; overflow:auto; padding: 8px 16px; }
.filter-chip { background:#1d1e27; color:#fff; border:1px solid rgba(255,255,255,.08); padding:8px 12px; border-radius:999px; white-space:nowrap; cursor:pointer; font-weight:700; }
.filter-chip.active { background:#2b2c36; border-color:#2b2c36; color:#c4ffc1; }

/* Desktop layout */
.desktop-only { display: none; }
.mobile-only { display: block; }

.header { position: sticky; top: 0; z-index: 10; background: rgba(11,11,15,.95); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,.08); }
.header-top { display:flex; align-items:center; gap:16px; padding: 14px 24px; max-width: var(--xl); margin: 0 auto; }
.header-top .brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 20px; letter-spacing: .5px; }
.header-top .brand-logo { font-size: 24px; }
.header-top .grow { flex: 1; }
.header-link { color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; padding: 8px 12px; transition: color 0.2s; }
.header-link:hover { color: var(--accent); }

/* Баланс звезд в шапке */
.header-stars-balance {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.15), rgba(234, 179, 8, 0.1));
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-left: 12px;
}
.header-stars-balance:hover {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.25), rgba(234, 179, 8, 0.15));
  transform: scale(1.05);
}
.header-stars-balance .stars-icon {
  font-size: 16px;
  color: #facc15;
}
.header-stars-balance .stars-count {
  font-size: 14px;
  font-weight: 700;
  color: #facc15;
}

.header-btn { color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 8px; background: rgba(255,255,255,.05); transition: background 0.2s; }
.header-btn:hover { background: rgba(255,255,255,.1); }
.header-btn-primary { color: #0b0b0f; background: #c4ffc1; text-decoration: none; font-size: 14px; font-weight: 700; padding: 8px 20px; border-radius: 8px; transition: background 0.2s; }
.header-btn-primary:hover { background: #b0eb9f; }
.header-nav { display:flex; gap: 24px; overflow:auto; max-width: var(--xl); margin: 0 auto; padding: 0 24px 14px; align-items: center; }
.header-nav .nav-link-wrapper { position: relative; }
.header-nav .nav-link { color: var(--text); text-decoration:none; font-weight: 500; font-size: 14px; white-space: nowrap; padding-bottom: 2px; border-bottom: 2px solid transparent; transition: border-color 0.2s; }
.header-nav .nav-link:hover { border-color: var(--accent); }
.header-nav .nav-link-highlight { color: #c4ffc1; font-weight: 700; }
.header-nav .nav-badge { position: absolute; top: -8px; right: -28px; background: #4ade80; color: #0b0b0f; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }

.hero-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card.hero { height: 260px; min-width: auto; width:auto; border-radius: 16px; }
.card.hero .hero-overlay { position:absolute; inset:0; display:flex; align-items:flex-end; padding: 14px; background: linear-gradient(180deg, rgba(0,0,0,.0) 40%, rgba(0,0,0,.55) 100%); }
.hero-title { font-size: 22px; font-weight: 900; }

.masonry { column-count: 4; column-gap: 16px; }
.masonry .card { width: 100%; height: auto; min-height: 220px; display: inline-block; margin: 0 0 16px; }

/* Tools Grid */
.tools-section { margin: 16px 0 20px; }
.tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tool-card { 
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; 
  padding: 20px 12px; border-radius: 16px; text-decoration: none; color: #fff; 
  min-height: 120px; box-shadow: 0 4px 16px rgba(0,0,0,.2); transition: transform 0.2s;
}
.tool-card:hover { transform: translateY(-4px); }
.tool-badge { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.25); backdrop-filter: blur(8px); padding: 4px 8px; border-radius: 8px; font-size: 10px; font-weight: 700; }
.tool-icon { font-size: 32px; margin-bottom: 8px; }
.tool-title { font-size: 12px; font-weight: 700; text-align: center; line-height: 1.3; white-space: pre-line; }

/* Tab Navigation */
.tab-nav { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 12px; }
.tab-nav-tabs { display: flex; gap: 12px; }
.tab-nav-btn { background: transparent; border: none; color: var(--muted); font-size: 20px; font-weight: 700; cursor: pointer; padding: 0; transition: color 0.2s; }
.tab-nav-btn.active { color: #ff6b35; border-bottom: 3px solid #ff6b35; padding-bottom: 4px; }
.tab-nav-more { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.tab-nav-more:hover { color: var(--text); }

/* Promo Banner */
.promo-banner { 
  background: linear-gradient(135deg, #8b5a3c 0%, #6d4c41 100%); 
  border-radius: 16px; padding: 16px 20px; margin: 20px 0;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.promo-content { display: flex; align-items: center; justify-content: space-between; }
.promo-text { flex: 1; }
.promo-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.promo-subtitle { font-size: 12px; color: rgba(255,255,255,.8); }
.promo-btn { 
  background: #ff5722; color: #fff; border: none; padding: 10px 20px; 
  border-radius: 20px; font-weight: 700; font-size: 13px; cursor: pointer;
  box-shadow: 0 2px 12px rgba(255,87,34,.4); transition: transform 0.2s;
}
.promo-btn:hover { transform: scale(1.05); }

/* Promo Slider - точный стиль higgsfield */
.promo-slider-higgsfield {
  position: relative;
  width: 100%;
  margin: 20px 0;
}

.promo-slider-container-higgsfield {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 20rem;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.promo-slider-container-higgsfield::-webkit-scrollbar {
  display: none;
}

@media (min-width: 640px) {
  .promo-slider-container-higgsfield {
    grid-auto-columns: 25rem;
  }
}

@media (min-width: 768px) {
  .promo-slider-container-higgsfield {
    grid-auto-columns: 30rem;
  }
}

@media (min-width: 1024px) {
  .promo-slider-container-higgsfield {
    grid-auto-columns: 35rem;
  }
}

@media (min-width: 1280px) {
  .promo-slider-container-higgsfield {
    grid-auto-columns: 40rem;
  }
}

.promo-slide {
  min-width: 0;
  height: 400px;
  position: relative;
  display: block;
  border-radius: 12px;
  padding: 8px;
  gap: 4px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
}

.promo-slide:hover {
  color: var(--primary);
}

.promo-slide:active {
  filter: brightness(0.6);
}

.promo-slide-media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  z-index: 0;
}

.promo-slide-content {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  padding: 16px 20px 24px;
  color: #fff;
  z-index: 2;
  text-align: left;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.7) 100%);
  border-radius: 0 0 8px 8px;
}

.promo-slide-subtitle {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.promo-slide-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.2;
}

.promo-slide-description {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 16px;
  line-height: 1.4;
}

.promo-slide-cta {
  display: inline-block;
  background: #fff;
  color: #0b0b0f;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.promo-slide-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

.promo-slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
}

.promo-slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  padding: 0;
}

.promo-slider-dot.active {
  background: #fff;
  transform: scale(1.3);
}

.promo-slider-dot:hover {
  background: rgba(255,255,255,.7);
}

/* Video Effects Section - точный стиль higgsfield */
.video-effects-section {
  margin: 60px 0;
  scroll-margin-top: 56px;
}

@media (min-width: 768px) {
  .video-effects-section {
    scroll-margin-top: 176px;
  }
}

.video-effects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px;
  padding: 0;
}

@media (min-width: 640px) {
  .video-effects-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (min-width: 768px) {
  .video-effects-grid {
    gap: 20px;
  }
}

.video-effects-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.home-screen-1 {
  margin: 20px 0 40px;
}

.home-screen-2 {
  margin: 0 0 40px;
}

@media (min-width: 960px) {
  #app { padding-bottom: 0; }
  .desktop-only { display: block; }
  .mobile-only { display: none; }
  .grid-3-desktop { grid-template-columns: repeat(3, 1fr); }
  .banner { height: 280px; margin: 20px auto; max-width: var(--xl); }
  .section-header { padding: 20px 0 12px; max-width: var(--xl); margin: 0 auto; }
  .h-scroll { padding: 0 0 12px; max-width: var(--xl); margin: 0 auto; gap: 16px; }
  .card { min-width: 180px; width: 180px; height: 240px; }
  
  .promo-slider-container-higgsfield {
    max-width: var(--xl);
    margin: 0 auto;
  }

  .promo-slide-content {
    padding: 24px 32px 32px;
  }

  .promo-slide-title {
    font-size: 24px;
  }

  .promo-slide-description {
    font-size: 15px;
  }

  .video-effects-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .effect-card-wrapper {
    min-width: 240px;
    height: 320px;
  }

  .home-screen-1 {
    margin: 32px 0 60px;
  }

  .home-screen-2 {
    margin: 0 0 60px;
  }
}

/* Visual Effects Screen - стиль higgsfield.ai */
.visual-effects-screen {
  margin: 40px 0 60px;
  padding: 0;
}

.visual-effects-title-container {
  padding: 20px 16px 24px;
}

.visual-effects-title {
  font-size: 48px;
  font-weight: 900;
  color: #6ce5b1;
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

@media (min-width: 640px) {
  .visual-effects-title {
    font-size: 64px;
  }
}

@media (min-width: 960px) {
  .visual-effects-title {
    font-size: 80px;
    padding: 0;
  }
  
  .visual-effects-title-container {
    padding: 40px 0 32px;
  }
}

/* Сетка тегов эффектов */
.visual-effects-tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 24px;
}

@media (min-width: 960px) {
  .visual-effects-tags-grid {
    padding: 0 0 32px;
    gap: 12px;
  }
}

.visual-effects-tag {
  background: rgba(26, 26, 34, 0.9);
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  color: #f6f7fb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.visual-effects-tag:hover {
  background: rgba(26, 26, 34, 1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.visual-effects-tag:active {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .visual-effects-tag {
    font-size: 14px;
    padding: 12px 18px;
  }
}

/* Превью эффектов */
.visual-effects-previews {
  padding: 0 16px 24px;
}

@media (min-width: 960px) {
  .visual-effects-previews {
    padding: 0 0 40px;
  }
}

.visual-effects-previews-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 640px) {
  .visual-effects-previews-grid {
    gap: 12px;
  }
}

@media (min-width: 960px) {
  .visual-effects-previews-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

.visual-effects-preview-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: var(--card);
  display: block;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.visual-effects-preview-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.visual-effects-preview-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.visual-effects-preview-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.visual-effects-preview-card:hover .visual-effects-preview-overlay {
  opacity: 1;
}

.visual-effects-preview-title {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.visual-effects-preview-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(108, 229, 177, 0.2);
  backdrop-filter: blur(8px);
  color: #6ce5b1;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 1;
}

.visual-effects-free-daily-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #00c853, #00e676);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0, 200, 83, 0.4);
  z-index: 2;
}

@media (min-width: 640px) {
  .visual-effects-preview-title {
    font-size: 16px;
  }
  
  .visual-effects-preview-badge {
    font-size: 12px;
    padding: 8px 14px;
  }
}
/* ========================================
   PROFILE PAGE STYLES (Appended Nov 19)
   ======================================== */

/* Profile Page Styles */
.profile-page {
  max-width: 960px;
  margin: 0 auto;
  padding-top: 20px;
}

.profile-header-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--card);
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.profile-header-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.profile-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 32px;
  font-weight: 700;
}

.profile-header-info {
  flex: 1;
}

.profile-name {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.profile-email {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 4px 0;
}

.profile-username {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.profile-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid rgba(255,255,255,0.1);
}

.profile-tab {
  padding: 12px 24px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.profile-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.profile-tab-content {
  display: none;
}

.profile-tab-content.active {
  display: block;
}

/* Profile Mobile Adaptations */
@media (max-width: 768px) {
  .profile-page {
    padding: 16px;
    padding-bottom: 100px;
  }
  
  /* Header card - вертикальный layout на мобильных */
  .profile-header-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 20px 16px;
  }
  
  .profile-header-info {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .profile-name {
    font-size: 20px;
  }
  
  /* Кнопка редактировать - на всю ширину */
  .profile-header-card .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Табы - горизонтальный скролл */
  .profile-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 0;
    padding-bottom: 0;
  }
  
  .profile-tabs::-webkit-scrollbar {
    display: none;
  }
  
  .profile-tab {
    padding: 12px 16px;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  /* Settings sections */
  .settings-section {
    margin-bottom: 20px;
  }
  
  .settings-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
  }
  
  .settings-card {
    padding: 16px;
  }
  
  .settings-field {
    margin-bottom: 16px;
  }
  
  .settings-field label {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .profile-header-card {
    padding: 16px 12px;
  }
  
  .profile-header-avatar {
    width: 64px;
    height: 64px;
  }
  
  .profile-avatar-placeholder {
    font-size: 24px;
  }
  
  .profile-name {
    font-size: 18px;
  }
  
  .profile-email,
  .profile-username {
    font-size: 13px;
  }
  
  .profile-tab {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* Generations Grid */
.generations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.generation-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s;
}

.generation-card:hover {
  transform: translateY(-4px);
}

.generation-preview {
  width: 100%;
  height: 160px;
  background: rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
}

.generation-preview video,
.generation-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: rgba(255,255,255,0.2);
}

.status-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.status-done {
  background: rgba(108, 229, 177, 0.2);
  color: var(--accent);
}

.status-badge.status-processing {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
}

.status-badge.status-error {
  background: rgba(255, 92, 122, 0.2);
  color: var(--danger);
}

.status-badge.status-queued {
  background: rgba(255, 209, 70, 0.2);
  color: var(--gold);
}

.generation-info {
  padding: 12px;
}

.generation-date {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.generation-template {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.generation-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  padding: 6px 12px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.action-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* Settings Section */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-card {
  background: var(--card);
  padding: 24px;
  border-radius: 12px;
}

.settings-card h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 700;
}

.settings-field {
  margin-bottom: 16px;
}

.settings-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.settings-field input {
  width: 100%;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}

.settings-field input:focus {
  outline: none;
  border-color: var(--primary);
}

.settings-field input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-group {
  margin-bottom: 16px;
}

.form-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

.form-success {
  color: var(--accent);
  font-size: 12px;
  margin-top: 4px;
}

/* Subscription Card */
.subscription-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 12px;
  margin-bottom: 16px;
}

.sub-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sub-title {
  font-size: 16px;
  font-weight: 700;
}

.sub-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.sub-badge.status-pro {
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: #fff;
}

.sub-badge.status-free {
  background: rgba(255,255,255,0.1);
  color: var(--muted);
}

.sub-expiry {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Credits Card */
.credits-card {
  background: linear-gradient(135deg, var(--gold) 0%, var(--orange) 100%);
  padding: 24px;
  border-radius: 12px;
  color: #000;
}

.credits-card h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 700;
  opacity: 0.8;
}

.credits-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}

.credits-value {
  font-size: 48px;
  font-weight: 900;
}

.credits-info span {
  font-size: 18px;
  opacity: 0.8;
}

.progress-bar-container {
  height: 8px;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
  transition: width 0.3s;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 700;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
}

/* Load More Button */
.load-more-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.load-more-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* Header Profile Dropdown Styles */
.header-profile {
  position: relative;
}

.profile-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s;
  z-index: 1000;
}

.profile-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dropdown-user-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.dropdown-user-email {
  font-size: 12px;
  color: var(--muted);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: rgba(255,255,255,0.1);
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 8px 0;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО КАРТОЧКИ ШАБЛОНА
   ============================================ */

/* Модальное окно на весь экран */
.template-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
  padding: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Оверлей-контейнер с прокруткой */
.template-modal-overlay {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 120px; /* Отступы для кнопки закрытия и нижней панели */
}

/* Контейнер контента модалки */
.template-modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Кнопка закрытия (красивая современная) */
.template-modal-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10001;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  padding: 0;
  pointer-events: auto; /* ВАЖНО: кнопка должна быть кликабельной */
  -webkit-tap-highlight-color: transparent; /* Убираем подсветку при тапе */
}

.template-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.template-modal-close:active {
  transform: scale(0.95);
  background: rgba(0, 0, 0, 0.9); /* Темнее при нажатии */
}

/* SVG иконка крестика */
.template-modal-close svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  transition: transform 0.2s ease;
  pointer-events: none; /* SVG не должен перехватывать клики */
}

.template-modal-close:hover svg {
  transform: rotate(90deg);
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
  .template-modal-close {
    top: 12px;
    right: 12px;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.8); /* Более контрастная на мобильных */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  }
  
  .template-modal-close svg {
    width: 22px;
    height: 22px;
    stroke-width: 3; /* Толще линии для лучшей видимости */
  }
}

/* Старый класс для совместимости */
.template-modal-close-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10001;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  padding: 0;
}

.template-modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.template-modal-close-btn:active {
  transform: scale(0.95);
}

/* Контейнер видео - адаптивный под формат */
.template-modal-video-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}

/* Видео - адаптивное под формат */
.template-modal-video {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  display: block;
}

/* Для мобильных - больше места для видео */
@media (max-width: 768px) {
  .template-modal-video {
    max-height: 60vh;
    border-radius: 12px;
  }
}

/* Информационная панель под видео */
.template-modal-info {
  width: 100%;
  max-width: 600px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Название шаблона */
.template-modal-title {
  font-size: 32px;
  font-weight: 700;
  color: white;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

/* Промпт превью */
.template-modal-prompt {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  max-width: 600px;
  line-height: 1.5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.template-modal-prompt-preview {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  line-height: 1.5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  margin-bottom: 20px;
  max-width: 100%;
}

/* Кнопка создания */
.template-modal-create-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 18px 48px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  text-transform: none;
  letter-spacing: 0.02em;
  width: auto;
  min-width: 280px;
}

.template-modal-create-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.template-modal-create-btn:active {
  transform: translateY(0);
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
  .template-modal-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .template-modal-close-btn {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 28px;
  }

  .template-modal-overlay {
    padding: 50px 15px 100px;
  }

  .template-modal-title {
    font-size: 24px;
  }

  .template-modal-prompt {
    font-size: 12px;
    max-width: 90%;
  }

  .template-modal-prompt-preview {
    font-size: 13px;
  }

  .template-modal-create-btn {
    padding: 16px 36px;
    font-size: 16px;
    min-width: 240px;
  }
}

/* ============================================
   ФОРМА ГЕНЕРАЦИИ КОНТЕНТА
   ============================================ */

/* Страница формы генерации */
.generation-form-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 84px; /* Оставляем место для мобильного toolbar (84px высота) */
  z-index: 50; /* Ниже toolbar (100), но выше обычного контента */
  overflow-y: auto;
  background: linear-gradient(180deg, #0f0f1e 0%, #1a1a2e 100%);
}

/* На десктопе toolbar скрыт - форма занимает весь экран */
@media (min-width: 960px) {
  .generation-form-page {
    bottom: 0;
  }
}

.generation-form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 100px; /* Отступ снизу для скролла */
}

/* Заголовок формы */
.generation-form-header {
  margin-bottom: 30px;
}

/* Кнопка "Назад" */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 1);
  transform: translateX(-2px);
}

.btn-back:active {
  transform: translateX(-1px);
}

.generation-form-header h2 {
  margin: 15px 0 5px;
  color: white;
  font-size: 28px;
  font-weight: 700;
}

.generation-form-header .muted {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

/* Превью видео в форме */
.generation-preview {
  margin-bottom: 30px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Превью видео в форме */
.generation-preview-video-container {
  margin-bottom: 30px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.generation-preview-video {
  width: 100%;
  height: auto;
  display: block;
  max-height: 400px;
  object-fit: contain;
}

/* Маленькое превью шаблона слева */
.template-preview-small {
  width: 100%;
  height: 160px; /* Фиксированная высота, компактнее */
  margin-bottom: 0; /* Убрал отступ */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  background: #000;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.template-preview-title {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px; /* Меньше шрифт */
  font-weight: 600;
  padding: 4px 8px; /* Меньше паддинги */
  border-radius: 6px;
  text-transform: uppercase;
}

.template-preview-video {
  width: 100%;
  height: auto;
  display: block;
  max-height: 200px;
  object-fit: cover;
}

/* Плейсхолдер для результата справа */
.generation-result-placeholder {
  width: 100%;
  height: 500px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.placeholder-icon {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.generation-result-placeholder h3 {
  color: rgba(255, 255, 255, 0.8);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
}

.generation-result-placeholder p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
}

/* ============================================
   GENERATION PROGRESS CONTAINER
   ============================================ */
.generation-progress-container {
  width: 100%;
  min-height: 500px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.progress-title {
  color: rgba(255, 255, 255, 0.9);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.progress-status {
  color: rgba(76, 175, 80, 0.9);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 30px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.progress-bar-container {
  width: 100%;
  max-width: 400px;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  border-radius: 10px;
  animation: progressAnimation 2s ease-in-out infinite;
  width: 70%;
}

@keyframes progressAnimation {
  0% {
    transform: translateX(-100%);
    opacity: 0.5;
  }
  50% {
    transform: translateX(50%);
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0.5;
  }
}

.progress-info {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  margin-bottom: 12px;
}

.progress-time {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-style: italic;
}

/* ============================================
   GENERATION RESULT CONTAINER
   ============================================ */
.generation-result-container {
  width: 100%;
  min-height: 500px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(76, 175, 80, 0.3);
  border-radius: 16px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-title {
  color: rgba(76, 175, 80, 0.95);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
}

.result-video {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  margin-bottom: 20px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #4CAF50, #8BC34A);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* ============================================
   GENERATION ERROR CONTAINER
   ============================================ */
.generation-error-container {
  width: 100%;
  min-height: 500px;
  background: rgba(255, 59, 48, 0.05);
  border: 2px solid rgba(255, 59, 48, 0.3);
  border-radius: 16px;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.error-title {
  color: rgba(255, 59, 48, 0.95);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.error-message {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  margin-bottom: 30px;
  max-width: 400px;
}

.btn-retry {
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-retry:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Секция загрузки изображения */
.upload-section {
  width: 100%;
  min-height: 140px; /* Изменил на min-height вместо height */
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 0;
  position: relative; /* Добавил для правильного z-index */
}

.upload-section:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.3);
}

.upload-icon {
  font-size: 24px;
  margin-bottom: 6px;
  opacity: 0.5;
  pointer-events: none; /* Не блокирует клики */
}

.upload-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  margin-bottom: 2px;
  line-height: 1.4;
  pointer-events: none; /* Не блокирует клики */
}

.upload-label {
  pointer-events: none; /* Не блокирует клики */
}

.upload-link {
  color: #c4ffc1;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto; /* Позволяет кликать */
}

.upload-link:hover {
  text-decoration: underline;
}

.upload-subtext {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  pointer-events: none; /* Не блокирует клики */
}

/* Превью загруженного изображения */
.upload-preview {
  position: relative;
  width: 100%;
  min-height: 140px;
  overflow: hidden;
  border-radius: 8px;
}

.upload-preview-image {
  width: 100%;
  height: 100%;
  min-height: 140px;
  object-fit: cover;
  display: block;
}

.upload-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
  z-index: 10;
}

.upload-remove-btn:hover {
  background: rgba(255, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.1);
}

/* Промпт инпут */
.prompt-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 14px;
  color: white;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
  margin-bottom: 8px;
}

.prompt-input:focus {
  outline: none;
  border-color: rgba(196, 255, 193, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.prompt-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Адаптивная двухколоночная раскладка для десктопа */
@media (min-width: 960px) {
  .generation-form-content {
    display: grid;
    grid-template-columns: 280px 1fr; /* Уменьшил ширину левой колонки */
    gap: 30px; /* Уменьшил отступ */
    max-width: 1600px;
    margin: 0 auto;
  }

  /* Левая колонка с настройками */
  .generation-form-left {
    display: flex;
    flex-direction: column;
    gap: 16px; /* Уменьшил отступы между элементами */
  }

  /* Правая колонка с результатом */
  .generation-form-right {
    position: sticky;
    top: 20px;
    height: fit-content;
  }

  .generation-result-placeholder {
    height: 80vh; /* Увеличил высоту плеера */
    min-height: 600px;
    background: #000;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  
  .template-preview-video {
    max-height: 160px; /* Уменьшил высоту видео */
    object-fit: cover;
  }
}

.section-title {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Название эффекта */
.effect-title {
  color: white;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 30px;
  letter-spacing: 1px;
}

/* Подсказка для промпта */
.prompt-hint {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

/* Адаптив для мобильных - все подряд */
@media (max-width: 959px) {
  .generation-form-content {
    display: flex;
    flex-direction: column;
  }

  .generation-form-left,
  .generation-form-right {
    width: 100%;
  }

  /* На мобильном видео идет после заголовка эффекта */
  .generation-form-right {
    order: 0;
  }
  
  .effect-title {
    order: -1;
  }

  .effect-title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .generation-preview-video-container {
    margin-bottom: 30px;
  }
}

/* Секция промпта */
.generation-prompt-section {
  margin-bottom: 25px;
}

.form-label {
  display: block;
  color: white;
  font-size: 16px;
  margin-bottom: 10px;
  font-weight: 500;
}

.prompt-display {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.6;
  min-height: 60px;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.form-hint {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

/* Секция добавления деталей */
.generation-addon-section {
  margin-bottom: 25px;
}

.prompt-addon-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px;
  color: white;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
  transition: all 0.3s ease;
}

.prompt-addon-input:focus {
  outline: none;
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.prompt-addon-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.char-counter {
  text-align: right;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 5px;
}

/* Секция настроек */
.generation-settings-section {
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.section-title {
  color: white;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 12px 14px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select:focus {
  outline: none;
  border-color: #667eea;
  background-color: rgba(255, 255, 255, 0.1);
}

.form-select option {
  background: #1a1a2e;
  color: white;
}

/* Информация о стоимости */
.generation-cost-info {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 25px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cost-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.cost-value {
  font-size: 24px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cost-balance {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

/* Большая кнопка генерации */
.btn-large {
  width: 100%;
  padding: 18px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Адаптив для формы */
@media (max-width: 768px) {
  .generation-form-header h2 {
    font-size: 24px;
  }

  .generation-preview-video {
    max-height: 200px;
  }

  .section-title {
    font-size: 16px;
  }

  .cost-value {
    font-size: 20px;
  }
}


/* ============================================
   ЗАГОЛОВОК ЭФФЕКТА (как на скриншоте)
   ============================================ */

.generation-effect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.generation-effect-title {
  font-size: 24px;
  font-weight: 700;
  color: #b4ff39;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(180, 255, 57, 0.3);
}

.generation-change-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.generation-change-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}


/* ============================================
   МОБИЛЬНАЯ ШАПКА В СТИЛЕ HIGGSFIELD
   Добавлено: 2025-11-20
   ============================================ */

/* Мобильная шапка */
.mobile-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.mobile-header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  height: 56px;
}

/* Логотип слева */
.mobile-header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
}

.mobile-header-logo-icon {
  font-size: 24px;
  line-height: 1;
}

.mobile-header-logo-text {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

/* Категория по центру */
.mobile-header-category {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.mobile-header-category-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-header-category-btn:active {
  background: rgba(255, 255, 255, 0.15);
}

.mobile-header-category-arrow {
  font-size: 10px;
  opacity: 0.7;
}

/* Бургер-меню справа */
.mobile-header-menu-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
}

.mobile-header-menu-icon {
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}

.mobile-header-menu-btn:active .mobile-header-menu-icon {
  background: var(--accent);
}

/* ============================================
   НИЖНЕЕ МЕНЮ В СТИЛЕ HIGGSFIELD (5 элементов)
   Обновлено: 2025-11-20
   ============================================ */

/* Обновленная навигация */
.toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 68px;
  display: flex;
  background: #000;
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
}

.toolbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-weight: 500;
  font-size: 11px;
  transition: color 0.2s;
  padding: 8px 4px;
  min-width: 0;
}

.toolbar-icon {
  font-size: 24px;
  line-height: 1;
}

.toolbar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.toolbar-item.active {
  color: #b4ff39;
}

.toolbar-item.active .toolbar-icon {
  transform: scale(1.1);
}

/* Центральная кнопка-звезда */
.toolbar-center {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-fab {
  position: absolute;
  top: -28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b4ff39 0%, #7dff00 100%);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(180, 255, 57, 0.4);
  border: 4px solid #000;
  transition: transform 0.2s;
  cursor: pointer;
}

.toolbar-fab:active {
  transform: scale(0.95);
}

.toolbar-fab-icon {
  font-size: 28px;
  line-height: 1;
}

/* Адаптивность для планшетов */
@media (min-width: 768px) {
  .mobile-header-container {
    padding: 12px 24px;
  }
  
  .toolbar {
    padding: 0 24px;
  }
}

/* Скрыть мобильную шапку на десктопе */
@media (min-width: 960px) {
  .mobile-header {
    display: none !important;
  }
}


/* ============================================
   FIXES & MODERNIZATION (2025-11-20 Update 2)
   Исправление отображения и улучшение дизайна
   ============================================ */

/* 1. СТРОГОЕ СКРЫТИЕ НА ДЕСКТОПЕ */
@media (min-width: 960px) {
  .mobile-only, 
  .mobile-header, 
  .toolbar {
    display: none !important;
  }
}

/* 2. СОВРЕМЕННАЯ МОБИЛЬНАЯ ШАПКА */
.mobile-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 60px;
  pointer-events: none; /* Пропускаем клики сквозь контейнер */
}

.mobile-header-glass {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-section {
  display: flex;
  align-items: center;
  flex: 1;
}

.header-section.center { justify-content: center; }
.header-section.right { justify-content: flex-end; }

/* Логотип */
.mobile-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
}

.mobile-logo-icon {
  font-size: 22px;
  background: linear-gradient(135deg, #fff 0%, #ccc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mobile-logo-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* Центральная пилюля (Context Pill) */
.context-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px 6px 16px;
  border-radius: 100px;
  color: #f6f7fb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.context-pill:active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.98);
}

/* Стили для отображения звезд в context-pill */
.context-pill.stars-pill .stars-icon {
  color: #fbbf24;
  font-size: 14px;
}

.context-pill.stars-pill .stars-count {
  font-weight: 700;
}

.chevron-down {
  font-size: 8px;
  opacity: 0.6;
  margin-top: 1px;
}

/* Бургер-меню (Современное) */
.burger-btn {
  background: none;
  border: none;
  padding: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  cursor: pointer;
}

.burger-line {
  height: 2px;
  background-color: #fff;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.burger-line:first-child { width: 24px; }
.burger-line:last-child { width: 16px; }

.burger-btn:active .burger-line {
  width: 24px;
  background-color: var(--accent);
}

/* 3. СОВРЕМЕННОЕ НИЖНЕЕ МЕНЮ */
.toolbar {
  height: 84px; /* Больше высоты для FAB */
  padding-bottom: 20px; /* Учет safe area */
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, #000 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
  align-items: flex-start; /* Выравнивание по верху для FAB */
  padding-top: 12px;
}

.toolbar-item {
  opacity: 0.5;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 6px;
}

.toolbar-item.active {
  opacity: 1;
  color: var(--accent);
}

.toolbar-item.active .toolbar-icon {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 8px rgba(180, 255, 57, 0.4));
}

.toolbar-icon {
  font-size: 22px;
}

.toolbar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* FAB (Центральная кнопка) */
.toolbar-center {
  margin-top: -28px; /* Поднимаем кнопку над баром */
}

.toolbar-fab {
  width: 64px;
  height: 64px;
  background: #b4ff39; /* Кислотный лайм */
  color: #000;
  box-shadow: 0 8px 24px rgba(180, 255, 57, 0.25), 
              0 2px 8px rgba(180, 255, 57, 0.2),
              inset 0 2px 4px rgba(255,255,255,0.5);
  border: none; /* Убираем черную обводку для чистоты */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px; /* Squircle форма */
  transform: rotate(45deg); /* Ромб */
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toolbar-fab-icon {
  font-size: 28px;
  transform: rotate(-45deg); /* Возвращаем иконку */
  display: block;
}

/* Эффект нажатия на FAB */
.toolbar-fab:active {
  transform: rotate(45deg) scale(0.9);
  box-shadow: 0 4px 12px rgba(180, 255, 57, 0.4);
}

/* Маленькая FAB кнопка для страниц генерации */
.toolbar-center-small {
  margin-top: -16px; /* Меньше подъём */
}

.toolbar-fab-small {
  width: 44px !important;
  height: 44px !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 12px rgba(180, 255, 57, 0.25) !important;
}

.toolbar-fab-small .toolbar-fab-icon {
  font-size: 20px;
}

.toolbar-fab-small .toolbar-fab-svg {
  width: 20px;
  height: 20px;
}

.toolbar-fab-small:active {
  transform: rotate(45deg) scale(0.92);
}

/* Компенсация отступа для контента, чтобы не перекрывался хедером/футером */
@media (max-width: 959px) {
  #app {
    padding-top: 0; /* Хедер sticky, не нужен padding */
    padding-bottom: 100px; /* Больше места снизу */
  }
  
  /* Скрываем десктопные элементы */
  .desktop-only {
    display: none !important;
  }
}


/* ============================================
   MOBILE ICONS & HEADER FIXES (2025-11-20 Update 3)
   ============================================ */

/* Fix Mobile Header Visibility */
.mobile-header {
  position: fixed !important; /* Ensure it's fixed */
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999; /* Very high z-index */
  height: 60px;
  pointer-events: none;
  display: block; /* Force display */
}

@media (min-width: 960px) {
  .mobile-header {
    display: none !important;
  }
}

/* Ensure content isn't hidden behind fixed header on mobile */
@media (max-width: 959px) {
  #app {
    padding-top: 60px !important; /* Match header height */
    padding-bottom: 100px !important;
  }
}

/* SVG Icons Styling */
.nav-svg-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.toolbar-item.active .nav-svg-icon {
  stroke-width: 2.5; /* Thicker stroke for active */
  filter: drop-shadow(0 0 5px rgba(180, 255, 57, 0.6));
}

/* FAB Icon Styling */
.toolbar-fab-svg {
  width: 28px;
  height: 28px;
  stroke: #000; /* Black icon on lime background */
  stroke-width: 2.5;
  transform: rotate(0deg); /* Ensure no rotation unless needed */
}

/* Fix toolbar icon container */
.toolbar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: inherit; /* Reset font size as we use SVG width/height */
}

/* ============================================
   MOBILE MENU LOGIC & STYLES (2025-11-20 Update 4)
   ============================================ */

/* Кнопка Try Free для неавторизованных */
.try-free-btn {
  background: #b4ff39;
  color: #000;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
}

.try-free-btn:active {
  transform: scale(0.96);
  background: #a3e632;
}

/* Выпадающее меню мобильной шапки */
.mobile-menu-dropdown {
  position: fixed;
  top: 60px; /* Высота хедера */
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
  z-index: 9998; /* Чуть ниже хедера */
}

.mobile-menu-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-menu-item {
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
}

.mobile-menu-item:active {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-item.danger {
  color: #ef4444;
}

.mobile-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 8px 0;
}

/* Анимация бургера */
.burger-btn {
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.burger-line {
  width: 24px;
  height: 2px;
  background-color: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Крестик при активном меню */
.burger-btn.active .burger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.burger-btn.active .burger-line:nth-child(2) {
  opacity: 0;
}

.burger-btn.active .burger-line:nth-child(3) { /* Добавим третью линию для полноценного бургера если нужно, но у нас 2 */
  /* Если было 2 линии, то анимация другая */
}

/* Адаптация для 2-х линий (как сейчас в коде) */
.burger-line:first-child {
  transform-origin: center;
}
.burger-line:last-child {
  transform-origin: center;
}

.burger-btn.active .burger-line:first-child {
  transform: translateY(4px) rotate(45deg);
}
.burger-btn.active .burger-line:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* ============================================
   DESIGN FIXES (2025-11-20 Update 5)
   ============================================ */

/* Улучшенная кнопка "Попробовать" */
.try-free-btn {
  background: linear-gradient(135deg, #b4ff39 0%, #7dff00 100%);
  color: #000;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 20px;
  border-radius: 24px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  box-shadow: 0 4px 12px rgba(180, 255, 57, 0.3);
  border: 1px solid rgba(0,0,0,0.1);
}

.try-free-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 6px rgba(180, 255, 57, 0.2);
}

/* Стилизация SVG иконок в меню */
.mobile-menu-item {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 14px 16px; /* Чуть больше воздуха */
}

.menu-item-icon {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  fill: currentColor;
  opacity: 0.8;
}

.mobile-menu-item:active .menu-item-icon {
  opacity: 1;
  transform: scale(1.1);
  transition: transform 0.2s;
}

/* Цветные иконки для важных пунктов */
.icon-lime { color: #b4ff39; }
.icon-blue { color: #60a5fa; }
.icon-purple { color: #c084fc; }
.icon-red { color: #f87171; }
.icon-yellow { color: #fbbf24; }

/* Разделитель */
.mobile-menu-divider {
  margin: 6px 16px; /* Отступы по бокам */
  background: rgba(255, 255, 255, 0.08);
}

/* ============================================
   FIX MENU CLICKS (2025-11-20 Update 6)
   ============================================ */

/* Исправление кликов в выпадающем меню */
.mobile-menu-dropdown {
  z-index: 9999 !important; /* Выше всех элементов */
  pointer-events: none; /* По умолчанию скрыто */
}

.mobile-menu-dropdown.active {
  pointer-events: auto !important; /* Когда открыто - кликабельно */
}

/* Убираем pointer-events:none с header, если меню активно */
.mobile-header:has(.mobile-menu-dropdown.active) {
  pointer-events: auto !important;
}

/* ============================================
   BUTTON & HEADER LAYOUT TWEAKS (2025-11-20 Update 7)
   ============================================ */

/* Уменьшаем кнопку "ПОПРОБОВАТЬ" */
.try-free-btn {
  font-size: 11px !important;
  padding: 0 14px !important;
  height: 32px !important;
  letter-spacing: 0.5px !important;
}

/* Корректировка сетки хедера для отступа от логотипа */
/* Логотип забирает место слева */
.header-section.left {
  flex: 0 0 auto !important; /* Логотип по содержимому */
  margin-right: auto; /* Толкаем всё остальное вправо */
}

/* Центральная секция с кнопкой сдвигается вправо */
.header-section.center {
  flex: 0 0 auto !important;
  margin-right: 8px; /* Отступ от бургера */
}

/* Бургер справа */
.header-section.right {
  flex: 0 0 auto !important;
}

/* Если нужно скрыть стандартную центровку */
.mobile-header-glass {
  justify-content: space-between; /* Распределяем: Лого ... Кнопка Бургер */
}

/* ============================================
   COMPACT UPLOAD PREVIEW (Added 2025-11-21)
   Оптимизация превью загруженного изображения
   ============================================ */

/* Контейнер при загруженном файле - сбрасываем стили большой зоны */
.upload-section.has-file {
  width: max-content !important; /* Занимает только место контента */
  min-height: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  margin-bottom: 16px; /* Отступ снизу */
}

/* Само превью - фиксированный квадрат */
.upload-section.has-file .upload-preview {
  width: 120px;
  height: 120px;
  min-height: 0;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Изображение внутри превью */
.upload-section.has-file .upload-preview-image {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover; /* Обрезаем лишнее, заполняя квадрат */
}

/* Кнопка удаления - делаем аккуратнее */
.upload-section.has-file .upload-remove-btn {
  width: 24px;
  height: 24px;
  font-size: 14px;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.upload-section.has-file .upload-remove-btn:hover {
  background: rgba(255, 0, 0, 0.8);
}

/* ============================================
   DYNAMIC MODEL CONFIGURATION UI (Added 2025-11-21)
   Стили для динамического интерфейса выбора моделей
   ============================================ */

/* Секция выбора модели */
.generation-model-section {
  margin-bottom: 24px;
}

.model-selector {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

/* Карточка модели */
.model-card {
  background: var(--card-bg, #1a1a1a);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.model-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.model-card.selected {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.1);
}

.model-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.model-card-header input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #4CAF50;
}

.model-card-name {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.model-card-info {
  margin-left: 32px;
}

.model-card-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
  line-height: 1.4;
}

.model-card-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.model-meta-item {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Контейнер динамических параметров */
.dynamic-params-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Секция параметра */
.param-section {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 16px;
}

.param-header {
  margin-bottom: 12px;
}

.param-label {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  display: block;
  margin-bottom: 4px;
}

.param-description {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}

/* Input элементы */
.form-select,
.form-input,
.form-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: #ffffff;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.form-select:focus,
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: #4CAF50;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ============================================
   SCENES (STORYBOARD)
   ============================================ */
.scenes-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============================================
   UPLOAD DISCLAIMER
   ============================================ */
.upload-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 152, 0, 0.08);
  border: 1px solid rgba(255, 152, 0, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
}

.disclaimer-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.disclaimer-text {
  font-size: 13px;
  color: rgba(255, 152, 0, 0.95);
  line-height: 1.5;
  font-weight: 500;
}

.scene-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s ease;
}

.scene-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.scene-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.scene-number {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scene-remove-btn {
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid rgba(255, 59, 48, 0.3);
  border-radius: 6px;
  color: #ff3b30;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scene-remove-btn:hover {
  background: rgba(255, 59, 48, 0.2);
  border-color: rgba(255, 59, 48, 0.5);
}

.scene-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 70px;
  margin-bottom: 10px;
  transition: border-color 0.2s ease;
}

.scene-textarea:focus {
  outline: none;
  border-color: rgba(76, 175, 80, 0.6);
}

.scene-textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.scene-duration {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scene-duration label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

.scene-duration-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  width: 80px;
  transition: border-color 0.2s ease;
}

.scene-duration-input:focus {
  outline: none;
  border-color: rgba(76, 175, 80, 0.6);
}

.btn-add-scene {
  width: 100%;
  background: rgba(76, 175, 80, 0.1);
  border: 1px dashed rgba(76, 175, 80, 0.4);
  border-radius: 10px;
  color: #4CAF50;
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.btn-add-scene:hover {
  background: rgba(76, 175, 80, 0.15);
  border-color: rgba(76, 175, 80, 0.6);
  transform: translateY(-1px);
}

.btn-add-scene:active {
  transform: translateY(0);
}

/* ============================================
   SCENES VALIDATION & INFO
   ============================================ */
.scenes-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
}

.warning-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.warning-text {
  font-size: 13px;
  color: rgba(255, 59, 48, 0.95);
  line-height: 1.5;
  font-weight: 500;
}

.scenes-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(76, 175, 80, 0.08);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
}

.info-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.info-text {
  font-size: 13px;
  color: rgba(76, 175, 80, 0.95);
  line-height: 1.5;
  font-weight: 500;
}

.form-input-small {
  width: 100px;
}

/* Textarea с счетчиком */
.textarea-container {
  position: relative;
}

.textarea-container .char-counter {
  text-align: right;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

/* Checkbox */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #4CAF50;
}

.checkbox-container label {
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

/* Множественная загрузка файлов */
.multi-upload-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upload-previews {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-preview-item {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.upload-preview-image-multi {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-remove-btn-multi {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
}

.upload-remove-btn-multi:hover {
  background: rgba(255, 0, 0, 0.8);
  transform: scale(1.1);
}

.upload-preview-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 11px;
  padding: 4px 8px;
  text-align: center;
  font-weight: 600;
}

.upload-zone-multi {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.02);
}

.upload-zone-multi:hover {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.05);
}

.upload-zone-multi .upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.upload-zone-multi .upload-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
  text-align: center;
}

.upload-zone-multi .upload-subtext {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

/* Сцены (для SORA) */
.scenes-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scenes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scene-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 16px;
}

.scene-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.scene-number {
  font-size: 14px;
  font-weight: 600;
  color: #4CAF50;
}

.btn-remove-scene {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 0, 0, 0.2);
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-remove-scene:hover {
  background: rgba(255, 0, 0, 0.6);
  transform: scale(1.1);
}

.scene-description {
  margin-bottom: 12px;
}

.scene-duration {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scene-duration label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.scene-duration input {
  width: 80px;
}

.btn-add-scene {
  background: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
  border: 1px solid rgba(76, 175, 80, 0.5);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-scene:hover {
  background: rgba(76, 175, 80, 0.3);
  border-color: #4CAF50;
}

/* Кнопки */
.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
  .model-card {
    padding: 12px;
  }
  
  .model-card-header {
    gap: 8px;
  }
  
  .model-card-name {
    font-size: 15px;
  }
  
  .model-card-info {
    margin-left: 28px;
  }
  
  .upload-preview-item {
    width: 100px;
    height: 100px;
  }
  
  .scene-item {
    padding: 12px;
  }
  
  .scene-duration {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .scene-duration input {
    width: 100%;
  }
}

/* Улучшение стилей для существующих элементов */
.generation-form-left {
  max-width: 600px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(76, 175, 80, 0.5);
}


/* ============================================
   GENERATION FORM REFACTOR (2025-11-21)
   ============================================ */

/* Layout Adjustments */
.generation-form-content {
  display: flex;
  gap: 32px;
  margin-top: 24px;
}

.generation-form-left {
  flex: 1;
  max-width: 500px; /* Ограничиваем ширину формы */
}

.generation-form-right {
  flex: 1.5;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Section Spacing */
.form-section {
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 24px;
}

.form-section:last-child {
  border-bottom: none;
}

/* 1. SLOTTED MEDIA UPLOAD */
.slotted-upload-wrapper {
  margin-bottom: 16px;
}

.upload-slots-container {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.upload-slot {
  width: 110px;
  height: 140px;
  background: rgba(255,255,255,0.05);
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.upload-slot:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.4);
}

.upload-slot.has-file {
  border-style: solid;
  border-color: transparent;
  background: #000;
}

.slot-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slot-icon {
  font-size: 24px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}

.slot-label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 0 4px;
}

.slot-label.filled {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 4px;
  font-size: 10px;
}

.slot-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  z-index: 2;
}

.slot-remove-btn:hover {
  background: #ff4444;
}

/* Photo Upload Specific Styles */
.photo-upload-wrapper {
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}

.photo-upload-wrapper .upload-header {
  margin-bottom: 12px;
}

.photo-upload-wrapper .section-title {
  font-size: 14px;
  color: #fff;
  margin: 0 0 4px 0;
}

.photo-upload-wrapper .section-description {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

.photo-slots {
  flex-wrap: wrap;
}

.photo-slot {
  width: 80px;
  height: 80px;
  min-width: 80px;
  background: rgba(255,255,255,0.05);
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 10px;
}

.photo-slot:hover {
  background: rgba(204,255,0,0.08);
  border-color: rgba(204,255,0,0.4);
}

.photo-slot.has-file {
  border: 2px solid rgba(204,255,0,0.5);
}

.photo-slot .slot-icon {
  font-size: 20px;
  color: rgba(204,255,0,0.6);
  margin-bottom: 4px;
}

.photo-slot .slot-label {
  font-size: 10px;
}

.upload-counter {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  text-align: center;
}

/* 2. COMPACT MODEL SELECTOR */
.model-selector-compact {
  position: relative;
  width: 100%;
}

.model-selected-display {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.08);
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.2s;
}

.model-selected-display:hover {
  background: rgba(255,255,255,0.12);
}

.model-selected-display.open {
  border-color: #4CAF50;
}

.model-info-compact {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.model-name {
  font-weight: 600;
  font-size: 14px;
}

.model-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.model-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1e1e1e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  margin-top: 8px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  overflow: hidden;
  max-height: 300px;
  overflow-y: auto;
}

.model-dropdown.hidden {
  display: none;
}

.model-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.model-dropdown-item:last-child {
  border-bottom: none;
}

.model-dropdown-item:hover {
  background: rgba(255,255,255,0.05);
}

.model-dropdown-item.active {
  background: rgba(76, 175, 80, 0.1);
  color: #4CAF50;
}

.model-cost-badge {
  margin-left: auto;
  font-size: 12px;
  background: rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* 3. TEXTAREA & INPUTS */
.form-textarea {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  padding: 12px;
  font-size: 14px;
  resize: vertical;
  transition: border-color 0.2s;
}

.form-textarea:focus {
  outline: none;
  border-color: #4CAF50;
}

/* 4. FOOTER */
.footer-cost-box {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
}

.cost-value {
  color: #FFD700;
}

.btn-generate-large {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border-radius: 12px;
  background: linear-gradient(45deg, #4CAF50, #45a049);
  border: none;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.3s;
}

.btn-generate-large:active {
  transform: scale(0.98);
}

.btn-generate-large:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-generate-large.hidden {
  display: none;
}

/* 5. RIGHT COLUMN PREVIEW */
.demo-reference-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}

.demo-caption {
  position: absolute;
  bottom: 20px;
  background: rgba(0,0,0,0.7);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  backdrop-filter: blur(4px);
}

.placeholder-info {
  position: absolute;
  text-align: center;
  z-index: 2;
}

.placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Mobile Adaptation */
@media (max-width: 900px) {
  .generation-form-content {
    flex-direction: column;
  }
  
  .generation-form-left {
    max-width: 100%;
  }
  
  .generation-form-right {
    min-height: 300px;
    order: -1; /* Move preview to top on mobile */
  }
}


/* ============================================
   SETTINGS & TEMPLATE UI UPDATES (2025-11-21)
   ============================================ */

/* 1. TEMPLATE PREVIEW (Top Left) */
.section-template {
  margin-bottom: 16px;
}

.template-mini-card {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  background: #000;
}

.template-mini-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

/* Для фото шаблона - вписываем полностью без обрезки */
.template-mini-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.9;
  background: #1a1a1a;
}

.template-mini-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}

.template-mini-title {
  font-size: 20px;
  font-weight: 800;
  color: #CCFF00; /* Lime Green accent like in screenshot */
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  letter-spacing: 1px;
}

.template-change-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* Блок выбора шаблона (свободный режим) */
.template-select-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(30,30,40,0.9) 0%, rgba(20,20,30,0.95) 100%);
  border: 2px dashed rgba(204,255,0,0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.template-select-card:hover {
  border-color: rgba(204,255,0,0.6);
  background: linear-gradient(135deg, rgba(40,40,50,0.9) 0%, rgba(30,30,40,0.95) 100%);
}

.template-select-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
}

.template-select-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(204,255,0,0.15);
  border: 2px solid rgba(204,255,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #CCFF00;
  font-weight: 300;
  transition: all 0.3s ease;
}

.template-select-card:hover .template-select-icon {
  background: rgba(204,255,0,0.25);
  border-color: rgba(204,255,0,0.6);
  transform: scale(1.1);
}

.template-select-text {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.template-select-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background 0.2s;
}

.template-change-badge:hover {
  background: rgba(255,255,255,0.3);
}


/* 2. SEGMENTED CONTROLS (Stylish Buttons for Settings) */
.segmented-control {
  display: flex;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.segmented-btn {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.segmented-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.segmented-btn.active {
  background: #4CAF50; /* Active Green */
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}


/* 3. CUSTOM CHECKBOX */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 0;
}

.checkbox-wrapper input {
  display: none; /* Hide default checkbox */
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  margin-right: 10px;
  position: relative;
  transition: all 0.2s;
}

.checkbox-wrapper input:checked + .custom-checkbox {
  background: #4CAF50;
  border-color: #4CAF50;
}

.checkbox-wrapper input:checked + .custom-checkbox::after {
  content: '✔';
  position: absolute;
  color: white;
  font-size: 12px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.checkbox-text {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
}


/* ============================================
   REFACTORED SETTINGS CONTROLS (Like Screenshot)
   ============================================ */

/* Контейнер для сетки настроек (Duration, Resolution в ряд) */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

/* Стиль кнопки-селектора (как на скриншоте) */
.setting-selector-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  position: relative;
}

.setting-selector-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.setting-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.setting-value {
  font-size: 15px;
  color: #fff;
  font-weight: 600;
}

.setting-arrow {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}

/* Выпадающее меню для настроек */
.setting-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 4px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  display: none;
}

.setting-dropdown-menu.active {
  display: block;
  animation: fadeIn 0.15s ease;
}

.setting-option {
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.setting-option.selected {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.setting-option.selected::after {
  content: '✓';
  color: #4CAF50;
  font-size: 12px;
}

/* ============================================
   MODEL SELECTOR CARDS (Redesign 2025-01)
   Расширенные карточки моделей с метаданными
   ============================================ */

/* Карточка модели в dropdown */
.model-option-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.model-option-card:last-child {
  border-bottom: none;
}

.model-option-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.model-option-card.selected {
  background: rgba(255, 255, 255, 0.08);
}

/* Верхняя строка: иконка, название, цена, галочка */
.model-option-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* Иконка модели */
.model-option-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

/* Контейнер для названия и описания */
.model-option-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Название модели */
.model-option-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Описание модели */
.model-option-subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.3;
}

/* Стоимость справа */
.model-option-cost {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #FFD700;
  background: rgba(255, 215, 0, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Галочка выбранной модели */
.model-option-check {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4CAF50;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.model-option-card.selected .model-option-check {
  opacity: 1;
}

/* Контейнер badges */
.model-option-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 26px; /* Выравнивание под название (18px icon + 8px gap) */
}

/* Базовый badge */
.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
}

/* Badge разрешения */
.model-badge-resolution::before {
  content: '';
  width: 10px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Crect x='2' y='3' width='20' height='14' rx='2'/%3E%3Cpath d='M8 21h8M12 17v4'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Badge длительности */
.model-badge-duration::before {
  content: '';
  width: 10px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Badge звука */
.model-badge-audio {
  color: rgba(255, 255, 255, 0.7);
}

.model-badge-audio::before {
  content: '';
  width: 10px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpath d='M11 5L6 9H2v6h4l5 4V5z'/%3E%3Cpath d='M15.54 8.46a5 5 0 010 7.07'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Расширенное dropdown меню для моделей */
.model-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: none;
  max-height: 70vh;
  overflow-y: auto;
  padding: 6px;
}

.model-dropdown-menu.active {
  display: block;
  animation: fadeIn 0.15s ease;
}

/* Mobile adaptations for model cards */
@media (max-width: 600px) {
  .model-option-card {
    padding: 10px 12px;
  }
  
  .model-option-icon {
    width: 16px;
    height: 16px;
    min-width: 16px;
    font-size: 9px;
  }
  
  .model-option-title {
    font-size: 13px;
  }
  
  .model-option-subtitle {
    font-size: 10px;
  }
  
  .model-option-badges {
    margin-left: 22px;
    gap: 4px;
  }
  
  .model-badge {
    font-size: 8px;
    padding: 1px 4px;
  }
  
  .model-option-cost {
    font-size: 11px;
    padding: 3px 6px;
  }
}

/* Стилизация выбора модели (как на скриншоте) */
.model-selector-modern {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.model-selector-modern:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.model-selector-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.model-selector-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.model-selector-value {
  font-size: 16px;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-selector-arrow {
  color: rgba(255, 255, 255, 0.4);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   MOBILE ADAPTATIONS FIX (2025-11-21)
   ============================================ */

@media (max-width: 900px) {
  /* 1. FIX ORDER: Form Top, Preview Bottom */
  .generation-form-content {
    flex-direction: column;
  }
  
  .generation-form-right {
    order: 2 !important; /* Preview goes to bottom */
    min-height: 300px;
    margin-top: 24px;
  }
  
  .generation-form-left {
    order: 1 !important; /* Settings stay on top */
  }

  /* 2. COMPACT SETTINGS BUTTONS */
  .settings-grid {
    /* На узких экранах - одна колонка для лучшей читаемости */
    grid-template-columns: 1fr; 
    gap: 8px;
  }

  .setting-selector-btn {
    padding: 10px 12px; /* Немного меньше отступы */
  }

  .setting-value {
    font-size: 14px; /* Чуть меньше шрифт */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px; /* Чтобы длинный текст не ломал кнопку */
  }
  
  .setting-label {
    font-size: 11px;
  }

  /* Компактная карточка превью шаблона */
  .template-mini-card {
    height: 140px; /* Меньше высота на мобильном */
  }

  /* Уменьшаем размер кнопок-сегментов */
  .segmented-btn {
    padding: 8px 4px;
    font-size: 12px;
  }
  
  /* Модель селектор компактнее */
  .model-selector-modern {
    padding: 12px;
  }
  
  .model-selector-value {
    font-size: 14px;
  }
}

/* ============================================
   CRITICAL MOBILE ORDER FIX (2025-11-21)
   ============================================ */

@media (max-width: 900px) {
  /* Жестко задаем колонку */
  .generation-form-content {
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Сбрасываем любые order, чтобы элементы шли как в DOM */
  /* DOM: Left (Settings) -> Right (Preview) */
  .generation-form-left {
    order: 0 !important; 
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .generation-form-right {
    order: 1 !important; /* Строго после настроек */
    width: 100% !important;
    margin-top: 32px !important;
    min-height: 300px !important;
  }
}

/* ============================================
   DESKTOP COMPACT FIX (2025-11-21)
   Making buttons neater on desktop
   ============================================ */

/* Делаем кнопку выбора модели компактнее */
.model-selector-modern {
  padding: 10px 14px !important; /* Было 16px */
  min-height: 50px;
}

.model-selector-value {
  font-size: 15px !important; /* Было 16px */
}

.model-selector-label {
  font-size: 11px !important; /* Было 12px */
  margin-bottom: 2px;
}

/* Делаем кнопки настроек (Quality, Duration) компактнее */
.setting-selector-btn {
  padding: 8px 12px !important; /* Было 12px 16px */
  min-height: 46px;
}

.setting-content {
  gap: 2px !important; /* Было 4px */
}

.setting-label {
  font-size: 11px !important; /* Было 12px */
}

.setting-value {
  font-size: 13px !important; /* Было 15px */
  line-height: 1.3;
}

/* Стрелочки тоже чуть меньше */
.setting-arrow, 
.model-selector-arrow {
  font-size: 12px !important;
  opacity: 0.5;
}

/* Корректировка сетки, чтобы кнопки не были слишком широкими если их мало */
.settings-grid {
  gap: 10px !important;
}

/* ============================================
   DESKTOP ULTRA-COMPACT FIX (2025-11-21)
   Strict single-line layout for neat buttons
   ============================================ */

/* 1. Кнопки настроек (Settings) */
.setting-selector-btn {
  padding: 6px 10px !important;
  min-height: 42px !important;
  max-height: 50px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.setting-content {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 0px !important;
  overflow: hidden; /* Важно для обрезки текста */
  flex: 1;
  margin-right: 8px;
}

.setting-label {
  font-size: 10px !important;
  color: rgba(255, 255, 255, 0.4) !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px !important;
  white-space: nowrap;
}

.setting-value {
  font-size: 13px !important;
  line-height: 16px !important;
  white-space: nowrap !important; /* Запрещаем перенос */
  overflow: hidden !important;
  text-overflow: ellipsis !important; /* Троеточие для длинного текста */
  font-weight: 600 !important;
}

/* 2. Кнопка выбора модели */
.model-selector-modern {
  padding: 8px 12px !important;
  min-height: 48px !important;
  max-height: 56px !important;
  margin-bottom: 12px !important;
}

.model-selector-info {
  overflow: hidden;
  flex: 1;
  margin-right: 10px;
}

.model-selector-value {
  font-size: 14px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* 3. Грид настроек - делаем более плотным */
.settings-grid {
  gap: 8px !important;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important; /* Адаптивные колонки */
}

/* Опции в выпадающем списке тоже компактнее */
.setting-option {
  padding: 8px 10px !important;
  font-size: 13px !important;
}

/* ============================================
   V2 COMPACT MODE (Guaranteed Apply)
   ============================================ */

/* Кнопки настроек в компактном режиме */
.compact-mode .setting-selector-btn {
  padding: 0 12px !important; /* Убираем вертикальный паддинг, центруем флексом */
  height: 48px !important;      /* Фиксированная высота */
  min-height: 48px !important;
  max-height: 48px !important;
  background: #1a1a1a !important; /* Более темный фон */
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.compact-mode .setting-content {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 2px !important;
  width: 100%;
  overflow: hidden;
}

.compact-mode .setting-label {
  font-size: 10px !important;
  text-transform: uppercase;
  color: #666 !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  margin: 0 !important;
}

.compact-mode .setting-value {
  font-size: 13px !important;
  color: #fff !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2 !important;
  padding-right: 8px;
}

.compact-mode .setting-arrow {
  font-size: 10px !important;
  color: #444 !important;
  flex-shrink: 0;
}

/* Выбор модели в компактном режиме */
.compact-mode .model-selector-modern {
  padding: 0 14px !important;
  height: 54px !important;
  min-height: 54px !important;
  background: #1a1a1a !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
}

.compact-mode .model-selector-info {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 2px !important;
}

.compact-mode .model-selector-label {
  font-size: 11px !important;
  color: #666 !important;
  text-transform: uppercase;
  font-weight: 700 !important;
}

.compact-mode .model-selector-value {
  font-size: 15px !important;
}

/* Грид настроек */
.compact-mode .settings-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important; /* Строго две колонки на десктопе */
  gap: 10px !important;
}

/* Мобильная адаптация для компактного режима */
@media (max-width: 600px) {
  .compact-mode .settings-grid {
    grid-template-columns: 1fr !important; /* Одна колонка на телефоне */
  }
}

/* ============================================
   V3 ULTRA-COMPACT LAYOUT (Less spacing)
   ============================================ */

/* Уменьшаем отступы между основными блоками */
.compact-mode .generation-form-content {
  gap: 20px !important; /* Было 32px */
  margin-top: 16px !important;
}

/* Убираем лишние отступы внутри секций */
.compact-mode .form-section {
  margin-bottom: 16px !important; /* Было 24px */
  padding-bottom: 0 !important;
  border-bottom: none !important; /* Убираем линии для плотности */
}

/* Заголовки секций */
.compact-mode .section-title {
  font-size: 12px !important;
  text-transform: uppercase;
  color: #888 !important;
  margin-bottom: 8px !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  font-weight: 700;
}

/* Уменьшаем отступы внутри промпта */
.compact-mode .section-prompt {
  margin-top: -8px !important; /* Подтягиваем промпт выше */
}

/* Сжимаем блок модели */
.compact-mode .model-selector-modern {
  margin-bottom: 8px !important;
}

/* Подтягиваем настройки */
.compact-mode .settings-grid {
  margin-top: 8px !important;
}

/* Уменьшаем высоту поля промпта */
.compact-mode .form-textarea {
  padding: 10px !important;
  min-height: 80px !important; /* Чуть меньше высота */
}

/* Подтягиваем слоты загрузки */
.compact-mode .slotted-upload-wrapper {
  margin-bottom: 12px !important;
}

/* ============================================
   MODEL SELECTOR DROPDOWN FIX (2025-11-21)
   Unified style with settings dropdown
   ============================================ */

/* Контейнер кнопки выбора модели должен быть relative для позиционирования меню */
.compact-mode .model-selector-modern {
  position: relative !important;
  z-index: 50 !important; /* Чтобы меню было поверх других элементов */
}

/* Само выпадающее меню модели */
.model-dropdown {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  background: #1e1e1e !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  padding: 4px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6) !important;
  z-index: 100 !important;
  max-height: 300px !important;
  overflow-y: auto !important;
  margin-top: 0 !important; /* Сбрасываем старые отступы */
}

/* Скрытое состояние */
.model-dropdown.hidden {
  display: none !important;
}

/* Пункты меню модели */
.model-dropdown-item {
  padding: 10px 12px !important;
  border-radius: 8px !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 14px !important;
  cursor: pointer !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-bottom: none !important; /* Убираем линии */
  background: transparent !important;
}

.model-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #fff !important;
}

.model-dropdown-item.active {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

/* Бейдж стоимости в меню */
.model-cost-badge {
  font-size: 12px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  color: #FFD700 !important;
}

/* ============================================
   UNIFIED MODEL SELECTOR (IDENTICAL TO SETTINGS)
   ============================================ */

.compact-mode .model-selector-modern {
  height: 48px !important;       /* Как у кнопок настроек */
  min-height: 48px !important;
  max-height: 48px !important;
  padding: 0 12px !important;    /* Идентичные отступы */
  border-radius: 10px !important;
  margin-bottom: 0 !important;   /* Убираем лишний отступ */
}

.compact-mode .model-selector-label {
  font-size: 10px !important;    /* Как у setting-label */
  color: #666 !important;
  margin: 0 !important;
  line-height: 1 !important;
}

.compact-mode .model-selector-value {
  font-size: 13px !important;    /* Как у setting-value */
  line-height: 1.2 !important;
  font-weight: 600 !important;
}

/* Выравниваем стрелочку */
.compact-mode .model-selector-arrow {
  font-size: 10px !important;
  color: #444 !important;
}

/* Меню выбора модели - точно как у настроек */
.model-dropdown {
  top: calc(100% + 4px) !important; /* Чуть ближе, как у настроек */
  border-radius: 12px !important;
  padding: 4px !important;
}

.model-dropdown-item {
  padding: 10px 12px !important;
  font-size: 13px !important;
  min-height: 40px !important; /* Чтобы пальцем попадать удобно */
}

/* ============================================
   PREMIUM LOADING & VIDEO PLAYER (2025-11-24)
   ============================================ */

/* 1. Premium Loading State (Cinema Card) */
.generation-progress-container {
  background: rgba(20, 20, 20, 0.6) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
  overflow: hidden !important;
  position: relative !important;
}

/* Shimmer Effect Background */
.generation-progress-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 150%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.03) 50%,
    transparent 100%
  );
  animation: shimmer 3s infinite linear;
  pointer-events: none;
}

@keyframes shimmer {
  0% { left: -150%; }
  100% { left: 150%; }
}

/* Pulsating Center Icon */
.progress-loader-icon {
  font-size: 64px;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 20px rgba(204, 255, 0, 0.4));
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* Modern Progress Bar */
.progress-bar-wrapper {
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 100px !important;
  height: 6px !important;
  overflow: hidden !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3) !important;
}

.progress-bar {
  background: linear-gradient(90deg, #CCFF00, #00FF88) !important;
  box-shadow: 0 0 15px rgba(204, 255, 0, 0.5) !important;
}

/* Status Text */
.progress-status {
  color: #CCFF00 !important; /* Neon Green */
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: 2px !important;
  text-transform: uppercase !important;
  font-size: 14px !important;
  margin-bottom: 16px !important;
}

.progress-tips {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 24px;
  max-width: 80%;
  line-height: 1.5;
}

/* 2. Premium Video Player Container */
.generation-result-video-wrapper {
  background: #000 !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  overflow: hidden !important;
  position: relative !important;
  transition: transform 0.3s ease !important;
}

/* Video Player Controls Customization (Webkit) */
.generation-result-video::-webkit-media-controls-panel {
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent) !important;
}

/* Download Button in Player Context */
.video-actions-bar {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
  justify-content: center;
}

.btn-action-modern {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-action-modern:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-action-modern.primary {
  background: #CCFF00;
  color: #000;
  border: none;
  font-weight: 700;
}

.btn-action-modern.primary:hover {
  background: #b3e600;
  box-shadow: 0 5px 20px rgba(204, 255, 0, 0.3);
}


/* ============================================
   VIDEO PLAYER FIX (2025-11-24)
   ============================================ */

/* Ensure video wrapper doesn't stretch */
.generation-result-video-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Video should maintain aspect ratio */
.generation-result-video {
  width: 100% !important;
  height: auto !important;
  max-height: 70vh !important;
  object-fit: contain !important;
  border-radius: 12px !important;
}

/* Actions bar should be centered below video */
.video-actions-bar {
  display: flex !important;
  gap: 12px !important;
  margin-top: 0 !important;
  width: auto !important;
  justify-content: center !important;
}


/* ============================================
   HISTORY GALLERY (2025-11-24) - Compact Icons
   ============================================ */

.history-gallery-section {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.history-gallery-title {
  display: none; /* Скрываем заголовок для компактности */
}

.history-gallery-grid {
  display: flex;
  gap: 8px;
}

.history-gallery-item {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: #000;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.history-gallery-item:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.history-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2px 4px;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 8px;
  text-align: center;
}

.history-gallery-item:hover .history-overlay {
  opacity: 1;
}

.history-date {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

/* Mobile: показываем 2 миниатюры */
@media (max-width: 900px) {
  .history-gallery-section {
    top: 10px;
    right: 10px;
    gap: 6px;
  }
  
  .history-gallery-grid {
    gap: 6px;
  }
  
  .history-gallery-item {
    width: 40px;
    height: 40px;
  }
}

/* ============================================
   FAB MENU - Bottom Sheet Style
   ============================================ */

.fab-menu-container {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end; /* Прижимаем к низу */
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.fab-menu-container.active {
  opacity: 1;
  pointer-events: auto;
}

.fab-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  transition: background 0.3s ease;
}

.fab-menu {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px; /* Ограничение ширины на десктопе */
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 16px 40px 16px; /* Большой паддинг снизу */
  background: rgba(20, 20, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  touch-action: none; /* Важно для обработки свайпов в JS */
}

.fab-menu-container.active .fab-menu {
  transform: translateY(0);
}

/* Ручка для перетаскивания */
.fab-menu-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 8px auto;
}

.fab-menu-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.fab-menu-option:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.08);
}

/* Стили для Видео */
.fab-menu-option.option-video .fab-menu-icon {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Стили для Фото */
.fab-menu-option.option-photo .fab-menu-icon {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Стили для Музыки */
.fab-menu-option.option-music .fab-menu-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.fab-menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  flex-shrink: 0;
}

.fab-menu-icon svg {
  width: 28px;
  height: 28px;
  stroke: #fff;
  stroke-width: 2;
}

.fab-menu-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fab-menu-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.fab-menu-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

/* ============================================
   SITE FOOTER - Статичный подвал сайта
   ============================================ */

.site-footer {
  background: linear-gradient(180deg, var(--bg) 0%, #0a0a0d 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 60px;
  padding-bottom: 100px; /* Отступ для мобильной навигации */
}

.footer-container {
  max-width: var(--xl);
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
}

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.footer-rustore-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.footer-rustore-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.footer-rustore-link svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.footer-nav {
  min-width: 160px;
}

.footer-nav-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 16px 0;
}

.footer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
  display: inline-block;
}

.footer-link:hover {
  color: var(--text);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.footer-bottom .footer-container {
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-copyright {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  text-align: center;
}

/* Footer адаптивность */
@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 30px 16px;
    text-align: center;
  }
  
  .footer-brand {
    max-width: 100%;
  }
  
  .footer-nav {
    min-width: auto;
  }
  
  .footer-nav-list {
    gap: 12px;
  }
  
  .footer-link {
    font-size: 15px;
    padding: 4px 0;
  }
}

/* ============================================
   LEGAL PAGES - Юридические страницы
   ============================================ */

.legal-page {
  min-height: 100vh;
  padding: 20px 0 60px;
}

.legal-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.legal-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.legal-updated {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 32px 0;
}

.legal-section {
  margin-bottom: 32px;
}

.legal-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px 0;
}

.legal-section p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 12px 0;
}

.legal-section ul,
.legal-section ol {
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 12px 0;
  padding-left: 24px;
}

.legal-section li {
  margin-bottom: 8px;
}

.legal-important {
  background: rgba(255, 92, 122, 0.1);
  border-left: 3px solid var(--danger);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  color: var(--text);
}

.legal-note {
  background: rgba(99, 102, 241, 0.1);
  border-radius: 12px;
  padding: 16px 20px;
}

.legal-note p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
}

.legal-back {
  margin-top: 40px;
  text-align: center;
}

.btn-secondary {
  display: inline-block;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s ease, transform 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

/* ============================================
   CONTACTS PAGE - Страница контактов
   ============================================ */

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.contact-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.contact-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.contact-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.contact-icon.telegram {
  background: linear-gradient(135deg, #229ED9, #1DA1F2);
}

.contact-icon svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

.contact-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px 0;
}

.contact-value {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
  margin: 0 0 8px 0;
}

.contact-link {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-link:hover {
  color: var(--accent);
}

.contact-description {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* FAQ секция */
.faq-item {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
}

.faq-item h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px 0;
}

.faq-item p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  line-height: 1.6;
}

/* Contacts адаптивность */
@media (max-width: 768px) {
  .contacts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .legal-title {
    font-size: 24px;
  }
}

/* ============================================
   REQUISITES PAGE - Страница реквизитов
   ============================================ */

.requisites-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.requisites-table {
  width: 100%;
  border-collapse: collapse;
}

.requisites-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.requisites-table tr:last-child {
  border-bottom: none;
}

.requisites-table td {
  padding: 14px 0;
  vertical-align: top;
}

.requisites-label {
  color: var(--muted);
  font-size: 14px;
  width: 40%;
  padding-right: 20px;
}

.requisites-value {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

/* ============================================
   COOKIE BANNER - Баннер согласия на cookies
   ============================================ */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(20, 20, 28, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
  padding: 16px 20px;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.cookie-banner-visible {
  transform: translateY(0);
  opacity: 1;
}

.cookie-banner-hiding {
  transform: translateY(100%);
  opacity: 0;
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cookie-banner-text {
  flex: 1;
}

.cookie-banner-text p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}

.cookie-banner-link {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.cookie-banner-link:hover {
  color: #8b8dff;
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  white-space: nowrap;
}

.cookie-btn-accept {
  background: #b4ff39;
  color: #000;
  box-shadow: 0 4px 16px rgba(180, 255, 57, 0.3);
}

.cookie-btn-accept:hover {
  background: #c4ff5a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(180, 255, 57, 0.4);
}

.cookie-btn-accept:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(180, 255, 57, 0.3);
}

/* Мобильная версия cookie banner */
@media (max-width: 768px) {
  .cookie-banner {
    padding: 12px 16px;
    /* Учитываем мобильную навигацию */
    bottom: 70px;
  }

  .cookie-banner-content {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .cookie-banner-text p {
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
  }

  .cookie-banner-actions {
    justify-content: center;
  }

  .cookie-btn {
    padding: 10px 24px;
    font-size: 13px;
    border-radius: 10px;
  }
}


/* ===========================================
   ПОДПИСКИ - SUBSCRIPTION PAGE
   =========================================== */

.subscription-page {
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(180deg, #0a0a0f 0%, #121218 100%);
}

.subscription-content {
  max-width: 1200px;
  margin: 0 auto;
}

/* Auth required */
.subscription-auth-required {
  text-align: center;
  padding: 80px 20px;
}

.subscription-auth-required h2 {
  font-size: 24px;
  color: #fff;
  margin-bottom: 16px;
}

.subscription-auth-required p {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 24px;
}

.auth-link {
  display: inline-block;
  padding: 12px 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.auth-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Payment messages */
.payment-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-weight: 500;
}

.payment-message.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.payment-message.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.payment-message .message-icon {
  font-size: 20px;
}

/* Header section */
.subscription-header-section {
  text-align: center;
  margin-bottom: 40px;
}

.subscription-header-section h1 {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subscription-header-section p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
}

/* Loading */
.subscription-loading {
  text-align: center;
  padding: 60px 20px;
}

.subscription-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error */
.subscription-error {
  text-align: center;
  padding: 40px 20px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.subscription-error p {
  color: #ef4444;
  margin-bottom: 16px;
}

.subscription-error button {
  padding: 10px 24px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

/* Notification */
.subscription-notification {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

.subscription-notification.info {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.subscription-notification.warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.subscription-notification.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.subscription-notification.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.subscription-notification.fade-out {
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Max plan message */
.max-plan-message {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(139, 92, 246, 0.1));
  border-radius: 16px;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.max-plan-message h2 {
  color: #a855f7;
  margin-bottom: 12px;
}

.max-plan-message p {
  color: rgba(255, 255, 255, 0.7);
}

/* Upgrade hint */
.upgrade-hint {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

/* Current subscription block */
.current-subscription-block {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.no-subscription {
  text-align: center;
  padding: 20px;
}

.no-subscription h3 {
  font-size: 18px;
  color: #fff;
  margin-bottom: 8px;
}

.no-subscription p {
  color: rgba(255, 255, 255, 0.5);
}

.subscription-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.subscription-header h3 {
  font-size: 20px;
  color: #fff;
}

.subscription-status {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.subscription-status.status-active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.subscription-status.status-pending {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.subscription-status.status-expired,
.subscription-status.status-cancelled {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

.subscription-status.status-suspended,
.subscription-status.status-failed {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.subscription-info {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.info-row {
  display: flex;
  gap: 12px;
}

.info-label {
  color: rgba(255, 255, 255, 0.5);
  min-width: 150px;
}

.info-value {
  color: #fff;
  font-weight: 500;
}

.info-value.auto-renew-on {
  color: #10b981;
}

.info-value.auto-renew-off {
  color: #9ca3af;
}

.subscription-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.action-btn.toggle-autorenew.on {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.action-btn.toggle-autorenew.off {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

.action-btn.cancel-btn {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.action-btn.cancel-btn-secondary {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.action-btn.cancel-btn-secondary:hover {
  background: rgba(156, 163, 175, 0.25);
  color: #d1d5db;
}

/* Expired subscription block */
.expired-subscription-block {
  background: rgba(245, 158, 11, 0.08);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.expired-subscription-block .subscription-header {
  border-bottom-color: rgba(245, 158, 11, 0.2);
}

.expired-warning {
  background: rgba(245, 158, 11, 0.1);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0;
  border-left: 3px solid rgba(245, 158, 11, 0.6);
}

.expired-warning p {
  color: #fbbf24;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.expired-warning .expired-warning-hint {
  margin-top: 8px;
  font-weight: 600;
}

.action-btn.cancel-expired-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-weight: 600;
}

.action-btn.cancel-expired-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.action-btn:hover {
  transform: translateY(-1px);
}

/* Plans section */
.subscription-plans-section {
  margin-top: 40px;
}

.subscription-plans-section h2 {
  font-size: 24px;
  color: #fff;
  margin-bottom: 24px;
  text-align: center;
}

.subscription-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: stretch;
}

/* Plan card */
.subscription-plan-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.subscription-plan-card:hover {
  transform: translateY(-4px);
  border-color: rgba(102, 126, 234, 0.3);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
}

.subscription-plan-card.recommended {
  border-color: rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.subscription-plan-card.current {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  padding: 4px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
}

.plan-badge.current-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.subscription-plan-card .plan-name {
  font-size: 20px;
  color: #fff;
  margin-bottom: 16px;
  margin-top: 8px;
}

.subscription-plan-card .plan-price {
  margin-bottom: 12px;
}

.subscription-plan-card .price-amount {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
}

.subscription-plan-card .price-currency {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
}

.subscription-plan-card .price-period {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

.subscription-plan-card .plan-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 20px;
}

.subscription-plan-card .plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex-grow: 1;
}

.subscription-plan-card .feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.subscription-plan-card .feature-check {
  color: #10b981;
  font-weight: bold;
}

.subscription-plan-card .feature-star {
  color: #fbbf24;
}

.subscription-plan-card .feature-item.bonus {
  color: #fbbf24;
  font-weight: 500;
}

.subscription-plan-card .feature-item.feature-unlimited {
  color: #c4ffc1;
  font-weight: 600;
}

.plan-select-btn {
  width: 100%;
  padding: 14px;
  background: #c4ffc1;
  color: #0b0b0f;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: auto;
}

.plan-select-btn:hover:not(:disabled) {
  background: #b0eb9f;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 255, 193, 0.3);
}

.plan-select-btn:disabled,
.plan-select-btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(196, 255, 193, 0.3);
  color: rgba(255, 255, 255, 0.6);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .subscription-page {
    padding: 16px;
    padding-bottom: 100px;
  }

  .subscription-header-section h1 {
    font-size: 24px;
  }

  .subscription-plans-grid {
    grid-template-columns: 1fr;
  }

  .subscription-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .info-row {
    flex-direction: column;
    gap: 4px;
  }

  .info-label {
    min-width: auto;
    font-size: 13px;
  }

  .subscription-actions {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
    text-align: center;
  }
}

/* ============================================
   МОДАЛЬНЫЕ ОКНА (Subscription Modal)
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.modal-visible {
  opacity: 1;
}

.modal-overlay.modal-closing {
  opacity: 0;
}

.modal-window {
  background: #1a1a1f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-visible .modal-window {
  transform: scale(1);
}

.modal-closing .modal-window {
  transform: scale(0.95);
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px;
  text-align: center;
}

.modal-message {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 24px;
  text-align: center;
  line-height: 1.6;
}

.modal-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  margin-bottom: 24px;
  outline: none;
  transition: border-color 0.2s;
}

.modal-input:focus {
  border-color: var(--accent, #6ce5b1);
}

.modal-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.modal-btn-primary {
  background: #c4ffc1;
  color: #0b0b0f;
}

.modal-btn-primary:hover {
  background: #b0eb9f;
  transform: translateY(-2px);
}

.modal-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.modal-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.modal-btn-danger {
  background: #ff5c7a;
  color: #fff;
}

.modal-btn-danger:hover {
  background: #ff3d5a;
  transform: translateY(-2px);
}

.modal-btn-default {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

/* Стили для разных типов модалок */
.modal-warning .modal-title {
  color: #fbbf24;
}

.modal-error .modal-title {
  color: #ff5c7a;
}

.modal-success .modal-title {
  color: #6ce5b1;
}

/* Адаптивность модальных окон */
@media (max-width: 480px) {
  .modal-window {
    padding: 24px 20px;
  }
  
  .modal-title {
    font-size: 20px;
  }
  
  .modal-message {
    font-size: 14px;
  }
  
  .modal-buttons {
    flex-direction: column;
  }
  
  .modal-btn {
    width: 100%;
  }
}

/* ============================================
   ИСТОРИЯ ГЕНЕРАЦИЙ (History Page)
   Добавлено: 2025-12-08
   ============================================ */

.history-page {
  padding: 20px;
  padding-bottom: 100px;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
}

.history-title {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 24px;
  color: var(--text-color);
  text-align: center;
}

/* Фильтры */
.history-filters {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.history-filter-btn {
  padding: 10px 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.history-filter-btn.active {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-color: transparent;
  color: white;
}

/* Сетка карточек - CSS Columns Masonry layout */
.history-grid {
  column-count: 2;
  column-gap: 16px;
  margin-bottom: 32px;
}

/* Карточка генерации */
.history-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.25s ease;
  break-inside: avoid;
  margin-bottom: 16px;
  display: inline-block;
  width: 100%;
}

.history-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Превью контейнер */
.history-card-preview {
  position: relative;
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Горизонтальный контент (16:9) */
.history-card:not(.history-card--vertical) .history-card-preview {
  aspect-ratio: 16 / 9;
}

/* Вертикальный контент (9:16) */
.history-card--vertical .history-card-preview {
  aspect-ratio: 9 / 16;
}

.history-card-preview video,
.history-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-card-preview video {
  cursor: pointer;
}

/* Иконка типа контента (видео) */
.history-card-type-icon {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  pointer-events: none;
}

/* Статус badge */
.history-card-status {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-card-status.queued {
  background: rgba(59, 130, 246, 0.8);
  color: white;
}

.history-card-status.processing {
  background: rgba(245, 158, 11, 0.8);
  color: white;
  animation: pulse 1.5s ease-in-out infinite;
}

.history-card-status.error {
  background: rgba(239, 68, 68, 0.8);
  color: white;
}

.history-card-status.cancelled {
  background: rgba(107, 114, 128, 0.8);
  color: white;
}

/* Состояния превью */
.history-card-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.history-card-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.1);
  color: rgba(239, 68, 68, 0.9);
}

.history-card-error .error-icon {
  font-size: 24px;
}

.history-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  opacity: 0.3;
}

/* Промпт (кликабельный для копирования) */
.history-card-prompt {
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  min-height: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.history-card-prompt:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
}

.history-card-prompt.copied {
  color: #c4ffc1;
}

/* Действия */
.history-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.history-action-btn {
  padding: 10px 18px;
  border: none;
  background: #c4ffc1;
  color: #0b0b0f;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.history-action-btn:hover {
  background: #b0eb9f;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(196, 255, 193, 0.3);
}

.history-action-btn.share-btn {
  flex: 1;
}

.history-action-btn.download-btn {
  padding: 10px 14px;
  min-width: 44px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.history-action-btn.download-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: none;
}

.history-action-btn.delete-btn {
  padding: 10px 14px;
  min-width: 44px;
  background: rgba(255, 70, 70, 0.1);
  color: #ff6b6b;
  border: 1px solid rgba(255, 70, 70, 0.2);
}

.history-action-btn.delete-btn:hover {
  background: rgba(255, 70, 70, 0.25);
  border-color: rgba(255, 70, 70, 0.4);
  box-shadow: none;
  transform: translateY(-2px);
}

.history-action-btn.delete-btn:active {
  transform: translateY(0);
}

/* Анимация удаления карточки */
.history-card--deleting {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.history-card-date {
  margin-left: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* Загрузчик */
.history-loader {
  display: flex;
  justify-content: center;
  padding: 32px;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Пустое состояние */
.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

.history-empty .empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.history-empty h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.8);
}

.history-empty p {
  font-size: 14px;
  margin-bottom: 24px;
}

/* Ошибка */
.history-error {
  text-align: center;
  padding: 48px 24px;
  color: rgba(239, 68, 68, 0.8);
}

.history-error p {
  margin-bottom: 16px;
}

/* Кнопка "Загрузить еще" */
.history-load-more {
  display: block;
  margin: 0 auto;
  padding: 14px 48px;
  font-size: 14px;
  min-height: 48px;
}

/* Адаптивность */
@media (max-width: 768px) {
  .history-page {
    padding: 16px;
    padding-bottom: 100px;
  }
  
  .history-title {
    font-size: 20px;
    margin-bottom: 20px;
  }
  
  .history-grid {
    column-gap: 12px;
  }
  
  .history-card {
    margin-bottom: 12px;
  }
  
  .history-filters {
    gap: 6px;
  }
  
  .history-filter-btn {
    padding: 8px 18px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .history-grid {
    column-count: 1;
  }
  
  .history-card-actions {
    flex-wrap: wrap;
  }
  
  .history-action-btn.share-btn {
    flex: 1;
    min-width: 100px;
  }
}

/* Профиль - превью генераций */
.generations-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.generations-info-block {
  margin-bottom: 16px;
  text-align: center;
}

.generations-info-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.generations-history-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .generations-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .generations-preview-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   SCENES EDITOR - Storyboard сцены
   ===================================================== */

.scenes-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

/* Заголовок с Total Duration и Remaining */
.scenes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.scenes-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scenes-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.scenes-total {
  font-size: 13px;
  color: var(--muted);
}

.scenes-remaining {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

.scenes-remaining.warning {
  color: var(--danger);
  font-weight: 600;
}

/* Список сцен */
.scenes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Карточка одной сцены */
.scene-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s;
}

.scene-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.scene-card:focus-within {
  border-color: var(--primary);
}

/* Заголовок карточки сцены */
.scene-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scene-number {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Кнопка удаления сцены */
.scene-delete-btn {
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--muted);
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scene-delete-btn:hover {
  background: rgba(255, 92, 122, 0.15);
  color: var(--danger);
}

.scene-delete-btn svg {
  width: 16px;
  height: 16px;
}

/* Textarea для описания сцены */
.scene-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s;
}

.scene-textarea::placeholder {
  color: var(--muted);
}

.scene-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* Поле длительности */
.scene-duration-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scene-duration-input {
  width: 80px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: border-color 0.2s;
}

.scene-duration-input:focus {
  outline: none;
  border-color: var(--primary);
}

.scene-duration-input::-webkit-inner-spin-button,
.scene-duration-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.scene-duration-input[type=number] {
  -moz-appearance: textfield;
}

.scene-duration-unit {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

/* Кнопка добавления сцены */
.scenes-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: transparent;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.scenes-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

/* Подсказка о лимите сцен */
.scenes-limit-hint {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 8px;
}

/* Адаптив для мобильных */
@media (max-width: 480px) {
  .scenes-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .scene-card {
    padding: 12px;
  }
  
  .scene-duration-input {
    width: 70px;
    padding: 8px 10px;
  }
}

/* ============================================
   BALANCE DISPLAY (Profile Settings)
   Добавлено: 2025-12-17
   ============================================ */

.balance-card {
  background: var(--card);
  padding: 20px;
}

.balance-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

.balance-icon {
  font-size: 24px;
}

.balance-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
}

.balance-label {
  font-size: 16px;
  color: var(--muted);
  font-weight: 500;
}

@media (max-width: 480px) {
  .balance-value {
    font-size: 28px;
  }
  
  .balance-label {
    font-size: 14px;
  }
}

/* ============================================
   PROMO CODE SECTION (Profile Balance)
   ============================================ */

.promo-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.promo-form-label {
  font-size: 13px;
  color: var(--muted, #888);
  margin-bottom: 10px;
  display: block;
}

.promo-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.promo-input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text, #fff);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  min-height: 48px;
}

.promo-input::placeholder {
  text-transform: none;
  letter-spacing: normal;
  color: rgba(255,255,255,0.3);
  font-weight: 400;
}

.promo-input:focus {
  border-color: rgba(196, 255, 193, 0.4);
  background: rgba(255,255,255,0.06);
}

.promo-submit-btn {
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  background: #c4ffc1;
  color: #0b0b0f;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 48px;
  min-width: 48px;
}

.promo-submit-btn:hover:not(:disabled) {
  background: #b0eb9f;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(196, 255, 193, 0.25);
}

.promo-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.promo-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(196, 255, 193, 0.3);
  color: rgba(255, 255, 255, 0.5);
}

.promo-message {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}

.promo-message-success {
  background: rgba(196, 255, 193, 0.08);
  color: #c4ffc1;
  border: 1px solid rgba(196, 255, 193, 0.15);
}

.promo-message-error {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.promo-status-badge {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}

.promo-activated {
  background: rgba(196, 255, 193, 0.08);
  color: #c4ffc1;
  border: 1px solid rgba(196, 255, 193, 0.15);
}

.promo-pending {
  background: rgba(234, 179, 8, 0.08);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.15);
}

@media (max-width: 480px) {
  .promo-input {
    font-size: 13px;
    padding: 10px 14px;
    min-height: 44px;
  }

  .promo-submit-btn {
    padding: 10px 18px;
    font-size: 13px;
    min-height: 44px;
  }
}

/* ============================================
   INLINE EDITABLE FIELDS (Profile Settings)
   Добавлено: 2025-12-17
   ============================================ */

/* Контейнер значения поля */
.field-value-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Отображение значения с кнопкой редактирования */
.field-value-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Текст значения */
.field-value-text {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

/* Кнопка-карандаш для редактирования */
.field-edit-btn {
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--muted);
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
}

.field-edit-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary);
}

.field-edit-btn svg {
  width: 16px;
  height: 16px;
}

/* Форма редактирования inline */
.field-edit-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

/* Обёртка для input с префиксом */
.edit-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.edit-input-wrapper:focus-within {
  border-color: var(--primary);
}

/* Префикс @ для username */
.edit-input-prefix {
  padding: 10px 0 10px 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  user-select: none;
}

/* Input поле редактирования */
.edit-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.edit-input::placeholder {
  color: var(--muted);
}

/* Кнопки сохранения и отмены */
.edit-buttons {
  display: flex;
  gap: 8px;
}

.edit-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  min-height: 36px;
}

.edit-btn-save {
  background: var(--primary);
  color: #fff;
}

.edit-btn-save:hover:not(:disabled) {
  background: var(--primary-hover, #5659de);
}

.edit-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.edit-btn-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.edit-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Сообщение об ошибке inline */
.edit-error {
  font-size: 12px;
  color: var(--danger);
  padding: 4px 0;
}

/* Адаптив для мобильных */
@media (max-width: 480px) {
  .edit-buttons {
    flex-direction: column;
  }
  
  .edit-btn {
    width: 100%;
  }
  
  .field-edit-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* =====================================================
   KANBAN BACKLOG STYLES
   ===================================================== */

/* Страница бэклога */
.admin-backlog {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.admin-backlog .admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-backlog .admin-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

/* Фильтры бэклога */
.backlog-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.backlog-filters .filter-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
}

.backlog-filters .filter-select {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
  min-width: 150px;
}

/* Статистика */
.backlog-stats {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.stats-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.stat-item {
  font-size: 14px;
  color: var(--text);
}

.stats-loading {
  color: var(--muted);
  font-size: 14px;
}

/* Kanban доска */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  min-height: 500px;
}

@media (max-width: 1024px) {
  .kanban-board {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Колонка Kanban */
.kanban-column {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 16px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, background 0.2s;
}

.kanban-column.drag-over {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.column-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.task-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--muted);
}

.column-tasks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  min-height: 100px;
}

/* Карточка задачи */
.task-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: grab;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.task-card:active {
  cursor: grabbing;
}

.task-card.dragging {
  opacity: 0.5;
  transform: rotate(3deg);
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.task-priority {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.task-category {
  font-size: 11px;
  font-weight: 500;
}

.task-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px 0;
  line-height: 1.4;
}

.task-description {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 10px 0;
  line-height: 1.5;
}

.task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.task-points {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.task-date {
  font-size: 11px;
  color: var(--muted);
}

/* Форма задачи в модальном окне */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
  .admin-backlog {
    padding: 16px;
  }
  
  .admin-backlog .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .backlog-filters {
    flex-direction: column;
  }
  
  .backlog-filters .filter-input,
  .backlog-filters .filter-select {
    width: 100%;
  }
}

/* ========================================
   APPS PAGE (Catalog)
   ======================================== */

.apps-catalog-page {
  min-height: 100vh;
  background: #11151e;
}

.apps-catalog-header {
  margin-bottom: 36px;
  padding-top: 40px;
}

.apps-catalog-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
  letter-spacing: 1px;
}

.apps-catalog-subtitle {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
}

.apps-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding-bottom: 100px;
}

.apps-card {
  background: #1a1f2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.apps-card:hover {
  border-color: rgba(0, 230, 118, 0.4);
  transform: translateY(-2px);
}

.apps-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(0, 230, 118, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.apps-card-icon-svg {
  width: 36px;
  height: 36px;
}

.apps-card-badge {
  font-size: 11px;
  font-weight: 600;
  color: #00e676;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.25);
  border-radius: 6px;
  padding: 2px 8px;
  align-self: flex-start;
}

.apps-card-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.apps-card-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
  line-height: 1.5;
  flex: 1;
}

.apps-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.apps-card-cost {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.apps-card-btn {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid #00e676;
  background: transparent;
  color: #00e676;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.apps-card-btn:hover {
  background: rgba(0, 230, 118, 0.1);
}

.apps-card--coming-soon {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.apps-card--coming-soon:hover {
  border-color: rgba(255, 255, 255, 0.08);
  transform: none;
}

.apps-card-badge--soon {
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.apps-card-coming-soon-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 768px) {
  .apps-catalog-header {
    padding-top: 80px;
  }
}

/* ========================================
   ANGLES APP PAGE
   ======================================== */

.angles-app-page {
  background: #11151e;
  min-height: 100vh;
}

.angles-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 20px 100px;
}

.angles-header-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 30px;
}

.angles-back-btn {
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s;
  min-width: 44px;
  min-height: 44px;
}

.angles-back-btn:hover {
  opacity: 0.8;
}

.angles-header-text {
  text-align: center;
  flex: 1;
}

.angles-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: 0.5px;
}

.angles-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}

.angles-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 30px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .angles-layout {
    grid-template-columns: 1fr;
  }
}

.angles-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100%;
}

.angles-form-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 20px;
}

.angles-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.angles-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Upload drop zone */
.angles-dropzone {
  border: 1.5px dashed rgba(76, 175, 80, 0.3);
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.angles-dropzone:hover,
.angles-dropzone.dragover {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.03);
}

.angles-dropzone-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.angles-dropzone-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
}

.angles-dropzone-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  display: block;
}

.angles-upload-preview {
  width: 100%;
  position: relative;
}

.angles-upload-preview-img {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: 8px;
}

.angles-upload-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s;
  min-width: 44px;
  min-height: 44px;
}

.angles-upload-remove:hover {
  background: rgba(255, 100, 100, 0.8);
}

/* Angles selector */
.angles-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.angles-select-all-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 44px;
  min-height: 32px;
}

.angles-select-all-btn.active {
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
}

.angles-selector-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 480px) {
  .angles-selector-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.angles-selector-card {
  background: transparent;
  border: 1px solid rgba(0, 230, 118, 0.25);
  border-radius: 8px;
  padding: 10px 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 44px;
}

.angles-selector-card:hover {
  border-color: rgba(0, 230, 118, 0.5);
}

.angles-selector-card.active {
  background: rgba(0, 230, 118, 0.05);
  border-color: #00e676;
}

.angles-card-index {
  font-size: 15px;
  font-weight: 800;
  color: #00e676;
  transition: color 0.2s;
}

.angles-card-name {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.angles-card-desc {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.4);
}

.angles-cost-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.angles-cost-label {
  color: rgba(255, 255, 255, 0.5);
}

.angles-cost-value {
  color: #fff;
  font-weight: 700;
}

.angles-generate-btn {
  width: 100%;
  min-height: 48px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0d1e16;
  color: #00e676;
  border: 1px solid #00e676;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.angles-generate-btn:hover:not(:disabled) {
  background: rgba(0, 230, 118, 0.1);
}

.angles-generate-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.angles-generate-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Preview / results column */
.angles-preview {
  background: #151a24;
  border-radius: 12px;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.angles-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}

.angles-placeholder-icon {
  width: 72px;
  height: 72px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.angles-placeholder-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

.angles-placeholder-sub {
  font-size: 12px !important;
  color: rgba(255, 255, 255, 0.3) !important;
  margin: 0;
}

/* Carousel */
.angles-carousel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
}

.angles-carousel-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
  flex: 1;
}

.angles-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.35s ease;
}

.angles-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.angles-carousel-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.angles-slide-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.angles-slide-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

.angles-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 230, 118, 0.15);
  border-top-color: #00e676;
  border-radius: 50%;
  animation: angles-spin 0.8s linear infinite;
}

@keyframes angles-spin {
  to { transform: rotate(360deg); }
}

.angles-slide-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #ff6b6b;
  font-size: 13px;
}

.angles-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.angles-carousel-arrow {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
  transition: background 0.2s, color 0.2s;
  min-width: 44px;
  min-height: 44px;
}

.angles-carousel-arrow:hover {
  background: rgba(0, 230, 118, 0.15);
  color: #fff;
}

.angles-carousel-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.angles-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}

.angles-carousel-dot.active {
  background: #00e676;
  width: 10px;
  height: 10px;
}

.angles-download-btn {
  align-self: center;
  min-width: 160px;
  min-height: 44px;
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #00e676;
  color: #11151e;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.angles-download-btn:hover {
  background: #00c853;
  transform: translateY(-2px);
}

/* Mobile */
@media (max-width: 959px) {
  .angles-container {
    padding-top: 80px;
  }

  .angles-layout {
    grid-template-columns: 1fr;
  }

  .angles-preview {
    min-height: 400px;
  }
}

/* ============================================
   MOTION DESIGN (md- prefix) — Two-column layout
   ============================================ */

.md-page {
  background: #11151e;
  min-height: 100vh;
  padding: 0 20px 100px;
}

/* Header */
.md-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  max-width: 1200px;
  margin: 0 auto;
}
.md-back-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.md-back-btn:hover { background: rgba(255,255,255,0.1); }
.md-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.md-beta-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  background: rgba(108,229,177,0.1);
  border: 1px solid rgba(108,229,177,0.25);
  border-radius: 6px;
  padding: 3px 8px;
}

/* Two-column layout */
.md-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

/* === LEFT SIDEBAR === */
.md-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 16px;
}
.md-sidebar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* Action cards */
.md-action-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.md-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.md-action-card:hover {
  border-color: rgba(255,255,255,0.15);
  background: #1e2230;
}
.md-action-card.active {
  border-color: var(--accent);
  background: rgba(108,229,177,0.05);
}
.md-action-card-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}
.md-action-card.active .md-action-card-icon {
  background: rgba(108,229,177,0.1);
  color: var(--accent);
}
.md-action-card-text {
  min-width: 0;
}
.md-action-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.md-action-card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Beta note */
.md-beta-note {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.md-beta-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

/* Prompt block */
.md-prompt-block {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.md-prompt-textarea {
  width: 100%;
  min-height: 56px;
  max-height: 120px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  font-family: inherit;
}
.md-prompt-textarea:focus { outline: none; }
.md-prompt-textarea::placeholder { color: var(--muted); }

/* Chips row */
.md-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.md-chip {
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  white-space: nowrap;
}
.md-chip:hover { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.08); }
.md-chip-add {
  color: var(--accent);
  border-color: rgba(108,229,177,0.25);
  background: rgba(108,229,177,0.06);
}
.md-chip-add:hover { background: rgba(108,229,177,0.12); }
.md-chip-theme.active {
  border-color: var(--accent);
  background: rgba(108,229,177,0.12);
  color: var(--accent);
}
.md-chip-dots {
  display: flex;
  gap: 2px;
}
.md-chip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.md-chip-more {
  width: 30px; height: 30px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}

/* Duration block */
.md-duration-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.md-duration-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.md-duration-options {
  display: flex;
  gap: 6px;
}
.md-duration-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 48px;
  justify-content: center;
}
.md-duration-option:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
}
.md-duration-option.active {
  background: rgba(108,229,177,0.1);
  border-color: var(--accent);
}
.md-duration-sec {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.md-duration-option.active .md-duration-sec {
  color: var(--accent);
}
.md-duration-cost {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.2;
}
.md-duration-option.active .md-duration-cost {
  color: var(--accent);
  opacity: 0.8;
}

/* Media row */
.md-media-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.md-media-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(108,229,177,0.08);
  border-radius: 10px;
  font-size: 11px;
  color: var(--accent);
}
.md-media-tag-rm {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 13px;
  padding: 0 2px;
  line-height: 1;
}

/* Settings panel (expandable) */
.md-settings-panel {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.md-settings-panel.open { display: flex; }
.md-setting-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.md-setting-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  min-width: 55px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.md-setting-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.md-mini-chip {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 28px;
}
.md-mini-chip:hover { border-color: rgba(255,255,255,0.2); }
.md-mini-chip.active {
  background: rgba(108,229,177,0.12);
  border-color: var(--accent);
  color: var(--accent);
}

/* Bottom row: cost + generate */
.md-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.md-cost-label {
  font-size: 12px;
  color: var(--muted);
}
.md-generate-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  background: linear-gradient(135deg, var(--accent), #4de8a0);
  border: none;
  border-radius: 10px;
  color: #0b0b0f;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 38px;
  white-space: nowrap;
}
.md-generate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(108,229,177,0.3);
}
.md-generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* === RIGHT MAIN === */
.md-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Preview area */
.md-preview {
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.md-preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.md-preview-placeholder svg {
  width: 100%;
  height: 100%;
}

/* Slider */
.md-slider {
  text-align: center;
  padding: 20px 0;
}
.md-slider-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(108,229,177,0.08);
  border: 1px solid rgba(108,229,177,0.2);
  border-radius: 6px;
  padding: 4px 10px;
  margin-bottom: 12px;
}
.md-slider-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 8px;
  line-height: 1.2;
}
.md-slider-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto 16px;
}

/* Slider navigation */
.md-slider-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.md-slider-arrow {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.md-slider-arrow:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}
.md-slider-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.md-slider-dot {
  width: 24px; height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.12);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
}
.md-slider-dot.active {
  background: var(--text);
  width: 32px;
}

/* Progress (inside preview) */
.md-progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px 20px;
  width: 100%;
}
.md-progress-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.md-progress-stepper {
  display: flex;
  gap: 24px;
  align-items: center;
}
.md-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.md-step-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  transition: all 0.3s;
}
.md-progress-step.done .md-step-dot {
  background: var(--accent);
  border-color: var(--accent);
}
.md-progress-step.active .md-step-dot {
  border-color: var(--accent);
  animation: mdPulse 1.5s infinite;
}
.md-step-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.md-progress-step.done .md-step-label { color: var(--accent); }
.md-progress-step.active .md-step-label { color: var(--text); }

@keyframes mdPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(108,229,177,0.2); }
  50% { box-shadow: 0 0 0 8px rgba(108,229,177,0.1); }
}

/* Error (inside preview) */
.md-error-wrap {
  text-align: center;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.md-error-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,92,122,0.15);
  color: var(--danger);
  font-size: 24px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.md-error-msg { font-size: 13px; color: var(--muted); }
.md-error-note { font-size: 12px; color: var(--accent); }
.md-retry-btn {
  margin-top: 8px;
  padding: 10px 24px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 40px;
}
.md-retry-btn:hover { background: rgba(255,255,255,0.1); }

/* Preset preview video */
.md-preview-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}

/* Result video */
.md-result-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}
.md-result-actions {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}
.md-dl-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 36px;
}
.md-dl-btn:hover { background: rgba(0,0,0,0.85); }

/* Refine block */
.md-refine-block {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.md-refine-textarea {
  flex: 1;
  min-height: 44px;
  max-height: 80px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  resize: none;
  font-family: inherit;
}
.md-refine-textarea:focus { outline: none; border-color: var(--accent); }
.md-refine-textarea::placeholder { color: var(--muted); }
.md-refine-btn {
  padding: 10px 18px;
  background: rgba(108,229,177,0.12);
  border: 1px solid rgba(108,229,177,0.25);
  border-radius: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
  white-space: nowrap;
}
.md-refine-btn:hover { background: rgba(108,229,177,0.2); }
.md-refine-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* History */
.md-history-block {
  display: flex;
  gap: 10px;
  align-items: center;
}
.md-history-timeline {
  display: flex;
  gap: 6px;
}
.md-history-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.md-history-dot:hover { border-color: rgba(255,255,255,0.2); }
.md-history-dot.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(108,229,177,0.1);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .md-layout {
    grid-template-columns: 1fr;
  }
  .md-sidebar {
    position: static;
  }
  .md-action-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .md-slider-title {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .md-page {
    padding: 0 12px 80px;
  }
  .md-action-cards {
    grid-template-columns: 1fr;
  }
  .md-preview {
    aspect-ratio: 4 / 3;
  }
  .md-slider-title {
    font-size: 18px;
  }
  .md-slider-desc {
    font-size: 13px;
  }
  .md-progress-stepper {
    flex-direction: column;
    gap: 12px;
  }
  .md-duration-options {
    gap: 4px;
  }
  .md-duration-option {
    padding: 6px 2px;
    min-height: 44px;
  }
  .md-duration-sec {
    font-size: 12px;
  }
}

/* ============================================
   MUSIC APP — AI Music (Suno V5)
   Uses project design system: var(--accent), var(--card), var(--text), var(--muted)
   Layout mirrors md-* (MotionDesign) pattern
   ============================================ */

/* ================================================================
   Music App — page, header, layout
   ================================================================ */
.music-page {
  background: #11151e;
  min-height: 100vh;
  padding: 0 20px 100px;
}

.music-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  max-width: 1200px;
  margin: 0 auto;
}

.music-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
}
.music-back-btn:hover { background: rgba(255,255,255,0.1); }

.music-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.music-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  border: 1px solid rgba(108,229,177,0.3);
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(108,229,177,0.06);
}

.music-content {
  max-width: 1440px;
  margin: 0 auto;
}

.music-layout {
  display: grid;
  grid-template-columns: 280px minmax(520px, 1fr) 260px;
  gap: 28px;
  max-width: 1440px;
  margin: 0 auto;
  align-items: start;
}

@media (max-width: 1180px) {
  .music-layout {
    grid-template-columns: 320px 1fr;
  }
}

@media (max-width: 900px) {
  .music-layout { grid-template-columns: 1fr; gap: 20px; }
  .music-form-col { order: 0; }
  .music-main-col { order: 1; }
  .music-side-col { order: 2; }
}

.music-form-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 16px;
  align-self: start;
}

.music-main-col,
.music-side-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (max-width: 1180px) {
  .music-side-col {
    grid-column: 1 / -1;
  }
}

.music-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1.2px;
  margin: 0 0 10px;
  text-transform: uppercase;
}

/* ================================================================
   Music App — Form card
   ================================================================ */
.music-form {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  min-width: 0;
}

.music-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.music-textarea {
  width: 100%;
  min-height: 64px;
  max-height: 140px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  resize: none;
  font-family: inherit;
  line-height: 1.55;
  box-sizing: border-box;
}
.music-textarea:focus { outline: none; }
.music-textarea::placeholder { color: rgba(139,141,152,0.7); }

.music-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  padding: 10px 12px;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
  min-height: 44px;
}
.music-input:focus {
  outline: none;
  border-color: var(--accent);
}
select.music-input option {
  background: #1a1a2e;
  color: #fff;
}
.music-file-input {
  padding: 8px 12px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.music-file-input::file-selector-button {
  margin-right: 10px;
  border: 1px solid rgba(108,229,177,0.2);
  background: rgba(108,229,177,0.08);
  color: var(--accent);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
}
.music-upload-status {
  min-height: 18px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(139,141,152,0.9);
}
.music-upload-status.is-uploading {
  color: var(--accent);
}
.music-upload-status.is-ready {
  color: rgba(108,229,177,0.95);
}
.music-upload-status.is-error {
  color: #ff6b6b;
}

.music-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.music-mashup-fields .music-form-row,
.music-add-vocals-fields .music-form-row,
.music-add-instrumental-fields .music-form-row,
.music-upload-cover-fields .music-form-row {
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (max-width: 600px) {
  .music-form-row { grid-template-columns: 1fr; gap: 8px; }
}

.music-field { display: flex; flex-direction: column; min-width: 0; }
.music-field-hint {
  margin-top: 6px;
  color: rgba(139,141,152,0.8);
  font-size: 11px;
  line-height: 1.45;
  font-style: italic;
}
.music-hidden { display: none !important; }

/* Field group wrappers (visibility via .music-hidden) */
.music-custom-fields,
.music-mashup-fields,
.music-add-vocals-fields,
.music-add-instrumental-fields,
.music-upload-cover-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ================================================================
   Music App — Mode grid
   ================================================================ */
.music-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.music-mode-btn {
  padding: 10px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  min-height: 44px;
  text-align: center;
  line-height: 1.3;
}
.music-mode-btn:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
}
.music-mode-btn.active {
  border-color: var(--accent);
  background: rgba(108,229,177,0.1);
  color: var(--accent);
}

/* ================================================================
   Music App — Toggle
   ================================================================ */
.music-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.music-toggle-label {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
  flex-shrink: 0;
}
.music-toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
}
.music-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 22px;
  transition: background 0.3s;
}
.music-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}
.music-toggle-input:checked + .music-toggle-slider {
  background: var(--accent);
}
.music-toggle-input:checked + .music-toggle-slider::before {
  transform: translateX(18px);
}
.music-toggle-text {
  color: var(--muted);
  font-size: 12px;
}

/* ================================================================
   Music App — Form footer / submit
   ================================================================ */
.music-form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
  flex-wrap: wrap;
}

.music-cost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #ffd93d;
  white-space: nowrap;
  flex-shrink: 0;
}

.music-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--accent), #4de8a0);
  color: #111;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  min-height: 44px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.music-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(108,229,177,0.3);
}
.music-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ================================================================
   Music App — Presets
   ================================================================ */
.music-presets-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.music-preset-btn {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  min-height: 44px;
  white-space: nowrap;
}
.music-preset-btn:hover {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
}
.music-preset-btn.active {
  border-color: var(--accent);
  background: rgba(108,229,177,0.12);
  color: var(--accent);
}

.music-preview-card {
  min-height: 580px;
  border-radius: 18px;
  border: 1px dashed rgba(108, 229, 177, 0.18);
  background:
    radial-gradient(circle at top, rgba(9, 24, 47, 0.8), rgba(3, 7, 18, 0.96)),
    rgba(255,255,255,0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.music-preview-icon {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: radial-gradient(circle at top, rgba(108,229,177,0.16), rgba(108,229,177,0.08));
  border: 1px solid rgba(108,229,177,0.16);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
}

.music-preview-title {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.music-preview-text {
  margin: 0;
  max-width: 420px;
  color: rgba(255,255,255,0.68);
  font-size: 15px;
  line-height: 1.65;
}

.music-preview-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 32px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: #112013;
  background: linear-gradient(135deg, var(--accent), #4de8a0);
  box-shadow: 0 12px 32px rgba(108,229,177,0.24);
  transition: transform 0.15s, box-shadow 0.15s;
}

.music-preview-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(108,229,177,0.3);
}

/* ================================================================
   Music App — History list
   ================================================================ */
.music-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.music-history-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px 16px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.music-history-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(108,229,177,0.2);
}
.music-history-title {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-history-meta {
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
  line-height: 1.5;
}
.music-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 16px 12px;
}

/* ================================================================
   Music App — Progress
   ================================================================ */
.music-progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 20px;
  padding: 40px 20px;
}
.music-progress-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 420px;
  width: 100%;
}
.music-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(108,229,177,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.music-spinner-small {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(108,229,177,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
.music-stage-label {
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
.music-progress-hint {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  max-width: 340px;
  line-height: 1.5;
}

/* ================================================================
   Music App — Result
   ================================================================ */
.music-result-wrap {
  width: 100%;
}
.music-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.music-result-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.music-new-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.2s, border-color 0.2s;
}
.music-new-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

/* ================================================================
   Music App — Track card
   ================================================================ */
.music-track-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.music-track-cover {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  object-fit: cover;
  align-self: center;
}
.music-track-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.music-track-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.music-track-tags {
  color: var(--muted);
  font-size: 11px;
}
.music-track-duration {
  color: var(--muted);
  font-size: 11px;
}
.music-audio-player {
  width: 100%;
  height: 38px;
  border-radius: 10px;
}
.music-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(108,229,177,0.08);
  border: 1px solid rgba(108,229,177,0.2);
  color: var(--accent);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.2s;
}
.music-download-btn:hover { background: rgba(108,229,177,0.15); }

/* ================================================================
   Music App — Post-actions
   ================================================================ */
.music-post-actions {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.music-actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.music-action-btn {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  min-height: 44px;
}
.music-action-btn:hover {
  background: rgba(108,229,177,0.08);
  border-color: rgba(108,229,177,0.25);
  color: var(--accent);
}

.music-secondary-result {
  margin-top: 14px;
  min-height: 20px;
}
.music-secondary-error {
  color: #ff6b6b;
  font-size: 13px;
  padding: 12px 14px;
  background: rgba(255,107,107,0.06);
  border-radius: 10px;
  border: 1px solid rgba(255,107,107,0.15);
}
.music-secondary-success {
  color: var(--text);
  font-size: 13px;
  padding: 12px 14px;
  background: rgba(108,229,177,0.06);
  border-radius: 10px;
  border: 1px solid rgba(108,229,177,0.15);
}
.music-lyrics-text {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,0.85);
  margin: 0;
}
.music-result-video {
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
  margin-top: 8px;
}

/* ================================================================
   Music App — Error
   ================================================================ */
.music-error-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  gap: 14px;
  text-align: center;
  padding: 40px 20px;
}
.music-error-title { color: #ff6b6b; font-size: 16px; font-weight: 700; }
.music-error-msg { color: var(--muted); font-size: 13px; max-width: 380px; line-height: 1.5; }

.music-inline-error {
  background: rgba(255,107,107,0.06);
  border: 1px solid rgba(255,107,107,0.15);
  color: #ff6b6b;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
  animation: fadeIn 0.2s ease;
}

/* ================================================================
   Music App — Advanced settings
   ================================================================ */
.music-adv-toggle {
  background: transparent;
  border: 1px dashed rgba(108,229,177,0.3);
  color: var(--accent);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  margin: 4px 0;
  transition: border-color 0.2s, background 0.2s;
}
.music-adv-toggle:hover {
  border-color: var(--accent);
  background: rgba(108,229,177,0.04);
}
.music-adv-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: rgba(108,229,177,0.03);
  border-radius: 12px;
  border: 1px solid rgba(108,229,177,0.08);
}

/* ================================================================
   Music App — Track selector
   ================================================================ */
.music-track-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid rgba(108,229,177,0.1);
}
.music-track-selector .music-label {
  margin-bottom: 0;
  white-space: nowrap;
  font-size: 13px;
}
.music-track-selector .music-input {
  flex: 1;
}

/* ================================================================
   Music App — Secondary form
   ================================================================ */
.music-secondary-form {
  margin-top: 16px;
  padding: 16px;
  background: rgba(108,229,177,0.03);
  border-radius: 12px;
  border: 1px solid rgba(108,229,177,0.1);
}
.music-secondary-form:empty {
  display: none;
  padding: 0;
  margin: 0;
  border: none;
}

/* ================================================================
   Music App — Cover preview
   ================================================================ */
.music-cover-preview {
  max-width: 280px;
  border-radius: 12px;
  margin: 6px;
}

/* ================================================================
   Music App — Lineage
   ================================================================ */
.music-lineage-section {
  margin-top: 28px;
}
.music-lineage-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid rgba(108,229,177,0.08);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 8px;
}
.music-lineage-card:hover {
  border-color: var(--accent);
  background: rgba(108,229,177,0.04);
}
.music-lineage-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
}
.music-lineage-meta {
  font-size: 12px;
  color: var(--muted);
}
.music-lineage-prompt {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================================================================
   Music App — Responsive
   ================================================================ */
@media (max-width: 600px) {
  .music-page { padding: 0 12px 80px; }
  .music-form-col { position: static; }
  .music-progress-card { padding: 32px 20px; }
  .music-preview-card {
    min-height: 420px;
    padding: 28px 20px;
  }
  .music-preview-title {
    font-size: 20px;
  }
  .music-preview-text {
    font-size: 14px;
  }
  .music-preview-submit {
    width: 100%;
  }
}

/* History — audio card support */
.history-card-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px 12px;
  min-height: 140px;
  background: rgba(108,229,177,0.04);
}
.history-card-audio-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.history-card-audio-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.history-card-audio-player {
  width: 100%;
  height: 32px;
  border-radius: 6px;
}

/* =========================
   FREE DAILY SECTION
   ========================= */
.free-daily-section {
  padding: 24px 0 16px;
}

.free-daily-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.free-daily-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

.free-daily-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 640px) {
  .free-daily-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

@media (min-width: 960px) {
  .free-daily-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

.free-daily-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: var(--card);
  display: block;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
  transition: transform 0.18s, box-shadow 0.18s;
}

.free-daily-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.35);
}

.free-daily-card-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.free-daily-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px;
  pointer-events: none;
}

.free-daily-badge {
  background: #22c55e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}

.free-daily-counter {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.free-daily-card-title {
  padding: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.free-daily-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.free-daily-global-counter {
  font-size: 13px;
  color: #22c55e;
  font-weight: 600;
}

.free-daily-timer {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Free Daily в модалке */
.template-modal-free-daily {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.free-daily-badge-modal {
  background: #22c55e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.free-daily-counter-modal {
  font-size: 13px;
  color: #22c55e;
  font-weight: 500;
}

.template-modal-create-btn--free {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  border-color: #22c55e !important;
}

.template-modal-create-btn--free:hover {
  background: linear-gradient(135deg, #16a34a, #15803d) !important;
}

/* Free Daily в форме генерации */
.btn-generate-free-daily {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  border-color: #22c55e !important;
  position: relative;
}

.btn-generate-free-daily:hover {
  background: linear-gradient(135deg, #16a34a, #15803d) !important;
}

.free-daily-btn-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  letter-spacing: 1px;
}

.free-daily-form-counter {
  text-align: center;
  font-size: 12px;
  color: #22c55e;
  font-weight: 500;
  margin-bottom: 8px;
}

.free-daily-banner {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin: 0 auto 10px;
  letter-spacing: 0.3px;
  text-align: center;
  width: fit-content;
}

.free-daily-banner--exhausted {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

/* =====================================================
   BLOGGER DASHBOARD
   ===================================================== */

.blogger-page {
  min-height: 100vh;
  background: #0a0a1a;
  color: #fff;
}

.blogger-login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 20px;
}

.blogger-login-form {
  width: 100%;
  max-width: 400px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 40px 32px;
}

.blogger-login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.blogger-login-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #fff;
}

.blogger-login-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

.blogger-form-group {
  margin-bottom: 20px;
}

.blogger-form-group label {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 6px;
}

.blogger-form-group input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.blogger-form-group input:focus {
  border-color: #6C5CE7;
}

.blogger-form-group input::placeholder {
  color: rgba(255,255,255,0.3);
}

.blogger-login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #6C5CE7, #a855f7);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  min-height: 48px;
}

.blogger-login-btn:hover {
  opacity: 0.9;
}

.blogger-login-btn:active {
  transform: scale(0.98);
}

.blogger-login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.blogger-error {
  color: #ff6b6b;
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 8px;
  text-align: center;
}

.blogger-error-block {
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.2);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: #ff6b6b;
  font-size: 14px;
}

.blogger-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px 0;
  max-width: 1100px;
  margin: 0 auto;
}

.blogger-dashboard-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 4px;
}

.blogger-dashboard-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

.blogger-logout-btn {
  padding: 10px 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 44px;
  min-width: 44px;
}

.blogger-logout-btn:hover {
  background: rgba(255,255,255,0.1);
}

.blogger-stats-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1100px;
  margin: 24px auto 0;
  padding: 0 32px;
}

.blogger-stat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px;
  transition: border-color 0.2s;
}

.blogger-stat-card:hover {
  border-color: rgba(255,255,255,0.15);
}

.blogger-stat-card--accent {
  background: linear-gradient(135deg, rgba(108,92,231,0.15), rgba(168,85,247,0.1));
  border-color: rgba(108,92,231,0.3);
}

.blogger-stat-card--accent:hover {
  border-color: rgba(108,92,231,0.5);
}

.blogger-stat-label {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}

.blogger-stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.blogger-stat-extra {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  margin-top: 6px;
}

.blogger-stat-card.skeleton {
  min-height: 100px;
}

.skeleton-line {
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  animation: blogger-skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-title {
  width: 60%;
  height: 14px;
  margin-bottom: 14px;
}

.skeleton-value {
  width: 40%;
  height: 28px;
}

@keyframes blogger-skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.blogger-charts {
  max-width: 1100px;
  margin: 32px auto 0;
  padding: 0 32px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.blogger-chart-block {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px;
}

.blogger-chart-title {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  margin: 0 0 16px;
}

.blogger-chart-canvas-wrap {
  width: 100%;
  overflow: hidden;
}

.blogger-chart-canvas {
  display: block;
  width: 100%;
}

.blogger-chart-empty {
  text-align: center;
  padding: 40px;
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .blogger-stats-cards {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 16px;
  }

  .blogger-charts {
    grid-template-columns: 1fr;
    padding: 0 16px 32px;
  }

  .blogger-header {
    padding: 20px 16px 0;
  }
}

@media (max-width: 480px) {
  .blogger-stats-cards {
    grid-template-columns: 1fr;
  }

  .blogger-stat-value {
    font-size: 24px;
  }

  .blogger-dashboard-title {
    font-size: 22px;
  }

  .blogger-login-form {
    padding: 28px 20px;
  }
}


/* ===== Clip generation page (public) ===== */

.clip-generation-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  color: #fff;
}
.clip-gen-loading,
.clip-gen-error {
  padding: 40px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}
.clip-gen-error .btn-clips {
  margin-top: 16px;
}

.clip-gen-back {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  padding: 6px 0;
  cursor: pointer;
  margin-bottom: 8px;
}
.clip-gen-back:hover { color: #fff; }
.clip-gen-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}
.clip-gen-description {
  margin: 0 0 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
}
.clip-gen-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}
.clip-gen-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.clip-gen-cover {
  margin: 16px 0;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}
.clip-gen-cover img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.clip-gen-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
}
.clip-gen-section-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}
.clip-gen-section-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

.clip-gen-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 28px 16px;
  background: rgba(168, 132, 255, 0.06);
  border: 1.5px dashed rgba(168, 132, 255, 0.4);
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.clip-gen-upload-zone:hover {
  background: rgba(168, 132, 255, 0.12);
  border-color: rgba(168, 132, 255, 0.6);
}
.clip-gen-upload-icon {
  font-size: 24px;
  font-weight: 700;
  color: #a884ff;
}
.clip-gen-upload-title {
  font-size: 14px;
  font-weight: 600;
}
.clip-gen-upload-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.clip-gen-photo-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  max-width: 280px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.clip-gen-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.clip-gen-photo-actions {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
}
.clip-gen-photo-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
}
.clip-gen-photo-btn:hover { background: rgba(0, 0, 0, 0.8); }
.clip-gen-photo-btn--danger:hover {
  background: rgba(255, 90, 90, 0.5);
  border-color: rgba(255, 90, 90, 0.7);
}

.clip-gen-submit {
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #a884ff 0%, #7d56e0 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.clip-gen-submit:hover:not(.clip-gen-submit--disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(168, 132, 255, 0.35);
}
.clip-gen-submit--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.clip-gen-job {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  text-align: center;
}
.clip-gen-job-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(168, 132, 255, 0.25);
  border-top-color: #a884ff;
  border-radius: 50%;
  animation: clip-gen-spin 0.9s linear infinite;
}
@keyframes clip-gen-spin {
  to { transform: rotate(360deg); }
}
.clip-gen-job-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}
.clip-gen-job-title--error { color: #ff7a7a; }
.clip-gen-job-hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}
.clip-gen-job-hint--soft {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}
.clip-gen-result-video {
  width: 100%;
  max-width: 600px;
  border-radius: 12px;
  background: #000;
}
.clip-gen-download {
  display: inline-block;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(168, 132, 255, 0.25);
  border: 1px solid rgba(168, 132, 255, 0.4);
  border-radius: 10px;
  text-decoration: none;
}
.clip-gen-download:hover { background: rgba(168, 132, 255, 0.4); }

/* ===== Clip generation preview tweaks ===== */

.clip-gen-preview-video {
  width: 100%;
  display: block;
  background: #000;
}
.clip-gen-cover--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 20px;
}

/* ===== Clip generation page (unified with photo generation layout) ===== */

.generation-form-clip-page .template-mini-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  height: auto;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.generation-form-clip-page .template-mini-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
}
.generation-form-clip-page .template-mini-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.45);
  font-size: 13px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

.generation-form-clip-page .clip-gen-meta-row {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.generation-form-clip-page .clip-gen-meta-title {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
  line-height: 1.3;
}
.generation-form-clip-page .clip-gen-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}
.generation-form-clip-page .clip-gen-meta-line .clip-gen-meta-dot {
  width: auto;
  height: auto;
  background: transparent;
  border-radius: 0;
  color: rgba(255,255,255,0.3);
  font-size: 11px;
}
.generation-form-clip-page .clip-gen-meta-description {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.65);
}

/* Suno Voice (custom voice cloning) */
.music-voices-btn {
  margin-left: auto;
  padding: 8px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}
.music-voices-btn:hover { background: rgba(255,255,255,0.14); }
.music-voices-wrap { display: flex; flex-direction: column; gap: 16px; }
.music-voices-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.music-voices-head .music-result-title { margin: 0; flex: 1 1 auto; }
.music-voice-list { display: grid; gap: 12px; }
.music-voice-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.music-voice-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.music-voice-name { font-weight: 600; font-size: 15px; }
.music-voice-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
}
.music-voice-status-ready { background: rgba(52,199,89,0.18); color: #34c759; }
.music-voice-status-awaiting_verify { background: rgba(255,159,10,0.18); color: #ff9f0a; }
.music-voice-status-validating, .music-voice-status-creating { background: rgba(10,132,255,0.18); color: #0a84ff; }
.music-voice-status-failed, .music-voice-status-expired { background: rgba(255,69,58,0.18); color: #ff453a; }
.music-voice-phrase { font-style: italic; color: rgba(255,255,255,0.7); font-size: 13px; }
.music-voice-error { color: #ff453a; font-size: 13px; }
.music-voice-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.music-voice-recorder {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

/* ============================================================
   Suno Voice wizard — модальное оформление в стиле Suno
   ============================================================ */
.voice-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  /* НЕ используем align-items: center — это обрезает верх модала, когда тот
     выше viewport (типичный flex+overflow баг: scroll-источник центрируется,
     до верхней границы оверлея не доскроллить). Вместо этого даём ребёнку
     margin: auto — модал центрируется, когда влезает, и прижимается к началу,
     когда нет, оставляя весь контент доступным через overflow-y: auto. */
  display: flex;
  justify-content: center;
  padding: 24px;
  z-index: 9000;
  overflow-y: auto;
}
.voice-modal {
  position: relative;
  background: #14141a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  width: min(100%, 900px);
  padding: 28px 32px 32px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
  /* Вертикальное центрирование через margin: auto на flex-ребёнке.
     Когда контент влезает — margins растягиваются и центрируют. Когда выше
     viewport — margins сжимаются до 0 и модал стартует с верха, давая полный
     доступ через скролл. */
  margin-top: auto;
  margin-bottom: auto;
}
.voice-modal-close,
.voice-modal-back {
  position: absolute;
  top: 18px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.voice-modal-back { left: 18px; }
.voice-modal-close { right: 18px; }
.voice-modal-close:hover,
.voice-modal-back:hover { background: rgba(255,255,255,0.12); }
.voice-modal-title {
  margin: 8px 0 0;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.voice-modal-langchip {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}
.voice-modal-langchip-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,0.45);
}
.voice-modal-phrase {
  align-self: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 14px 22px;
  font-size: 17px;
  font-weight: 500;
  text-align: center;
  max-width: 100%;
}
.voice-modal-help {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin: 0;
}
.voice-modal-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 4px;
}
.voice-tab-btn {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  font-size: 13px;
  min-height: 44px;
}
.voice-tab-btn.active {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-color: rgba(255,255,255,0.25);
}
.voice-tab-btn:disabled,
.voice-tab-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.voice-recorder-stage {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 28px 20px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.voice-wave-canvas {
  width: 100%;
  height: 90px;
  display: block;
}
.voice-rec-status {
  font-size: 13px;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,0.75);
  font-weight: 600;
  text-transform: uppercase;
}
.voice-rec-status .voice-rec-timer { color: #fff; margin-left: 6px; }

.voice-rec-btn {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  border: none;
  background: linear-gradient(180deg, #ff8a3d 0%, #ff6a1c 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(255,106,28,0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.voice-rec-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(255,106,28,0.55); }
.voice-rec-btn:active { transform: translateY(0); }
.voice-rec-btn.is-recording {
  background: linear-gradient(180deg, #ff8a3d 0%, #f04a00 100%);
  animation: voice-pulse 1.6s ease-in-out infinite;
}
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 8px 22px rgba(255,80,28,0.55); }
  50% { box-shadow: 0 10px 32px rgba(255,80,28,0.75); }
}

.voice-preview-card {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.voice-preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.voice-preview-play {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
}
.voice-preview-play:hover { background: rgba(255,255,255,0.1); }
.voice-preview-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.voice-preview-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-preview-size { font-size: 12px; color: rgba(255,255,255,0.45); }
.voice-preview-discard {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  font-size: 18px;
  padding: 6px;
}
.voice-preview-discard:hover { color: #fff; }

.voice-preview-wave-wrap {
  position: relative;
  width: 100%;
  height: 96px;
  user-select: none;
}
.voice-preview-wave {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}
.voice-trim-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
}
.voice-trim-info .voice-trim-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.voice-trim-info .voice-trim-selected {
  color: #d8b4ff;
  font-weight: 600;
}
.voice-trim-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin: 0;
}

.voice-modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.voice-next-btn {
  padding: 10px 26px;
  border-radius: 999px;
  background: #fff;
  color: #1a1a22;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  min-height: 44px;
}
.voice-next-btn:hover { background: rgba(255,255,255,0.85); }
.voice-next-btn:disabled { background: rgba(255,255,255,0.2); color: rgba(255,255,255,0.4); cursor: not-allowed; }

.voice-modal-error {
  background: rgba(255,69,58,0.12);
  border: 1px solid rgba(255,69,58,0.3);
  color: #ff6a5b;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
}
.voice-modal-info {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.voice-modal-info::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  animation: voice-spinner 0.9s linear infinite;
}
@keyframes voice-spinner { to { transform: rotate(360deg); } }

.voice-modal-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-size: 14px;
}
.voice-modal-input:focus {
  outline: none;
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
}
.voice-modal-input-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 6px;
  display: block;
}

.voice-file-input {
  display: none;
}
.voice-file-pickbtn {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  min-height: 44px;
}
.voice-file-pickbtn:hover { background: rgba(255,255,255,0.12); }

.voice-modal-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 0;
}
.voice-modal-progress .music-spinner { width: 48px; height: 48px; }
.voice-modal-progress-title { font-size: 18px; font-weight: 600; }
.voice-modal-progress-hint { font-size: 13px; color: rgba(255,255,255,0.55); text-align: center; }

.voice-tip-toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(12px);
  background: #1f1f28;
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255,209,102,0.5);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 12px 36px rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 11000;
  pointer-events: none;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.voice-tip-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  .voice-modal { padding: 22px 18px; border-radius: 16px; }
  .voice-modal-title { font-size: 22px; }
  .voice-rec-btn { width: 64px; height: 64px; border-radius: 16px; }
  .voice-recorder-stage { padding: 22px 12px; }
}

/* ============================================
   Play-бейдж поверх анимированных WebP-превью видео-карточек
   (главная: .visual-effects-preview-card, галерея шаблонов:
   .template-selector-card-media). Декоративный — pointer-events: none.
   ============================================ */
.has-video-badge::after {
  content: '\25B6\FE0E'; /* ▶ c принудительным текстовым начертанием (не эмодзи) */
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  line-height: 26px;
  text-align: center;
  text-indent: 2px; /* оптическое центрирование треугольника */
  pointer-events: none;
  z-index: 2;
}

/* В галерее шаблонов правый верхний угол карточки занят бейджем модели AI
   (.template-selector-card-model) — play-бейдж уводим в левый нижний угол */
.template-selector-card-media.has-video-badge::after {
  top: auto;
  right: auto;
  bottom: 8px;
  left: 8px;
}

/* ============================================================================
   Motion Studio (Этап Э7) — чат-агент «ролик под ключ». Добавление, не перезапись.
   ============================================================================ */
.ms-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 720px;
  margin: 0 auto;
  background: #0f1115;
  color: #f1f3f5;
}
.ms-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  padding-top: calc(10px + env(safe-area-inset-top));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  background: #0f1115;
  z-index: 2;
}
.ms-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: #f1f3f5;
  cursor: pointer;
  border-radius: 10px;
}
.ms-back-btn:hover { background: rgba(255, 255, 255, 0.06); }
.ms-header-titles { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; }
.ms-title { font-size: 18px; font-weight: 700; margin: 0; }
.ms-badge {
  font-size: 11px;
  font-weight: 700;
  color: #0f1115;
  background: #b4ff39;
  border-radius: 999px;
  padding: 2px 8px;
}
.ms-balance { font-size: 14px; font-weight: 600; color: #b4ff39; white-space: nowrap; }

.ms-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}
.ms-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.ms-bubble--agent {
  align-self: flex-start;
  background: #1b1f27;
  border-bottom-left-radius: 4px;
}
.ms-bubble--user {
  align-self: flex-end;
  background: #b4ff39;
  color: #0f1115;
  border-bottom-right-radius: 4px;
}
.ms-bubble--error {
  background: rgba(255, 92, 92, 0.12);
  border: 1px solid rgba(255, 92, 92, 0.4);
  color: #ffb3b3;
  align-self: flex-start;
}
.ms-bubble-text { white-space: pre-wrap; }
.ms-media { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.ms-media-video, .ms-media-img { width: 100%; border-radius: 12px; display: block; }
.ms-media-audio { width: 100%; }
.ms-result .ms-download { margin-top: 8px; display: inline-block; text-decoration: none; text-align: center; }

.ms-typing { display: inline-flex; align-items: center; gap: 8px; }
.ms-typing-dots { display: inline-flex; gap: 3px; }
.ms-typing-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #8b95a5;
  animation: ms-blink 1.2s infinite ease-in-out both;
}
.ms-typing-dots i:nth-child(2) { animation-delay: 0.2s; }
.ms-typing-dots i:nth-child(3) { animation-delay: 0.4s; }
.ms-typing-label { font-size: 13px; color: #8b95a5; }
@keyframes ms-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.ms-cost-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #141821;
}
.ms-cost-info { display: flex; flex-direction: column; }
.ms-cost-label { font-size: 12px; color: #8b95a5; }
.ms-cost-value { font-size: 18px; font-weight: 700; color: #b4ff39; }
.ms-cost-actions { display: flex; gap: 8px; }

.ms-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ms-btn--primary { background: #b4ff39; color: #0f1115; }
.ms-btn--ghost { background: transparent; color: #f1f3f5; border: 1px solid rgba(255, 255, 255, 0.18); }
.ms-retry { margin-top: 8px; min-height: 36px; }

.ms-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0f1115;
}
.ms-attach-input { display: none; }
.ms-attach-btn, .ms-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.ms-attach-btn { background: transparent; color: #8b95a5; }
.ms-attach-btn:hover { background: rgba(255, 255, 255, 0.06); }
.ms-send-btn { background: #b4ff39; color: #0f1115; }
.ms-send-btn:disabled, .ms-attach-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ms-input {
  flex: 1;
  min-height: 44px;
  max-height: 140px;
  resize: none;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #1b1f27;
  color: #f1f3f5;
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.35;
}
.ms-input:disabled { opacity: 0.6; }
.ms-input:focus { outline: none; border-color: #b4ff39; }

@media (max-width: 360px) {
  .ms-bubble { max-width: 92%; font-size: 14px; }
  .ms-title { font-size: 16px; }
}

/* ============================================================================
   Motion Studio REDESIGN (студия, две панели) — ms2-*  · Добавление, не перезапись
   Палитра — бренд-токены (:root): --bg/--card/--text/--muted/--primary/--accent.
   Гейтится флагом motion_studio_redesign_enabled. Старый блок ms-* НЕ трогаем.
   ============================================================================ */
.ms2-shell {
  /* Бренд-зелёный (мятный) акцент — CSS-переменная --accent (#6ce5b1), как в макете/скрине. */
  --ms2-accent: var(--accent, #6ce5b1);
  /* Тёмный текст/иконки НА акцентной заливке — мятный светлый, белый по нему нечитаем
     (WCAG ~1.6:1); тёмный даёт ~12:1. Во всех accent-filled контролах. */
  --ms2-on-accent: var(--bg, #0b0b0f);
  --ms2-line: rgba(255,255,255,.08);
  --ms2-panel: rgba(255,255,255,.02);
  display: flex;
  width: 100%;
  height: calc(100dvh - 96px);
  min-height: 560px;
  background: var(--bg, #0b0b0f);
  color: var(--text, #f6f7fb);
  overflow: hidden;
  position: relative;
}
.ms2-shell * { box-sizing: border-box; }

/* ---- chat panel ---- */
.ms2-chat {
  flex: 0 0 clamp(320px, 30vw, 420px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--ms2-line);
  background: var(--ms2-panel);
}
.ms2-shell.is-cinema .ms2-chat { flex-basis: clamp(300px, 24vw, 344px); }
.ms2-chat-head {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ms2-line);
}
.ms2-back, .ms2-newchat {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--ms2-line); border-radius: 11px;
  background: transparent; color: var(--text); cursor: pointer;
}
.ms2-back:hover, .ms2-newchat:hover { border-color: var(--ms2-accent); color: var(--ms2-accent); }
.ms2-chat-switch {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 6px 10px;
  background: transparent; border: 1px solid transparent; border-radius: 11px;
  color: var(--text); cursor: pointer; font: inherit; text-align: left;
}
.ms2-chat-switch:hover { background: rgba(255,255,255,.04); }
.ms2-chat-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms2-chevron { display: inline-flex; color: var(--muted); transition: transform .15s; }
.ms2-chat-switch.is-open .ms2-chevron { transform: rotate(180deg); }
.ms2-chat-menu {
  position: absolute; top: calc(100% - 4px); left: 12px; right: 12px; z-index: 20;
  padding: 7px; border-radius: 14px;
  background: var(--card, #1a1a22); border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
}
.ms2-chat-menu-title { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 8px; }
.ms2-chat-menu-list { display: flex; flex-direction: column; gap: 3px; max-height: 320px; overflow-y: auto; }
.ms2-chat-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--text); cursor: pointer; text-align: left; font: inherit;
}
.ms2-chat-row:hover { background: rgba(255,255,255,.04); }
.ms2-chat-row.is-active { background: color-mix(in srgb, var(--ms2-accent) 14%, transparent); border-color: color-mix(in srgb, var(--ms2-accent) 40%, transparent); }
.ms2-chat-row-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms2-chat-row-preview { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms2-chat-new {
  margin-top: 5px; width: 100%; min-height: 44px; padding: 10px 12px;
  border-radius: 10px; border: 1px dashed rgba(255,255,255,.16);
  background: transparent; color: var(--text); cursor: pointer; font: inherit; font-weight: 600;
}
.ms2-chat-new:hover { border-color: var(--ms2-accent); color: var(--ms2-accent); }

.ms2-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.ms2-bubble { max-width: 86%; padding: 11px 13px; border-radius: 4px 14px 14px 14px; background: #181b21; border: 1px solid var(--ms2-line); font-size: 13.5px; line-height: 1.5; }
.ms2-bubble--agent { align-self: flex-start; }
.ms2-bubble--user { align-self: flex-end; border-radius: 14px 4px 14px 14px; background: var(--card, #1a1a22); border-color: color-mix(in srgb, var(--ms2-accent) 22%, transparent); }
.ms2-bubble--error { border-color: var(--danger, #ff5c7a); }
.ms2-bubble-text { white-space: pre-line; }
.ms2-typing { display: inline-flex; align-items: center; gap: 9px; }
.ms2-typing-dots { display: inline-flex; gap: 3px; }
.ms2-typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ms2-accent); animation: ms2-blink 1.1s infinite; }
.ms2-typing-dots i:nth-child(2) { animation-delay: .2s; }
.ms2-typing-dots i:nth-child(3) { animation-delay: .4s; }
.ms2-typing-label { font-size: 12.5px; color: var(--muted); }
@keyframes ms2-blink { 0%,100%{opacity:1;} 50%{opacity:.25;} }
.ms2-media { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ms2-media-video, .ms2-media-img { width: 100%; max-width: 280px; border-radius: 10px; }
.ms2-media-audio { width: 100%; }
.ms2-retry { margin-top: 8px; }

.ms2-composer {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  margin: 12px; padding: 6px 6px 6px 8px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: var(--card, #1a1a22);
}
.ms2-composer.is-drag { border: 1.5px dashed var(--ms2-accent); background: color-mix(in srgb, var(--ms2-accent) 10%, transparent); }
.ms2-attach-input { display: none; }
.ms2-attach-btn, .ms2-send-btn { flex: 0 0 auto; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: none; border-radius: 11px; cursor: pointer; }
.ms2-attach-btn { background: transparent; color: var(--muted); }
.ms2-attach-btn:hover { color: var(--ms2-accent); }
.ms2-send-btn { background: var(--ms2-accent); color: var(--ms2-on-accent); }
.ms2-send-btn:disabled, .ms2-attach-btn:disabled { opacity: .45; cursor: not-allowed; }
.ms2-input { flex: 1; min-width: 0; max-height: 140px; resize: none; border: none; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 14px; padding: 10px 2px; }

/* ---- stage column ---- */
.ms2-stage-col { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.ms2-stepper-root { flex: 0 0 auto; }
.ms2-stage-root { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }

.ms2-stepper { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--ms2-line); overflow-x: auto; }
.ms2-step { display: flex; align-items: center; gap: 10px; background: transparent; border: none; cursor: pointer; color: var(--text); font: inherit; flex: 0 0 auto; padding: 0; }
.ms2-step.is-locked { cursor: default; }
.ms2-step-circle { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.05); color: var(--muted); border: 1px solid rgba(255,255,255,.1); }
.ms2-step-circle.is-active { background: var(--ms2-accent); color: var(--ms2-on-accent); border-color: var(--ms2-accent); }
.ms2-step-circle.is-done { background: color-mix(in srgb, var(--ms2-accent) 22%, transparent); color: var(--ms2-accent); border-color: color-mix(in srgb, var(--ms2-accent) 50%, transparent); }
.ms2-step-label { font-size: 13px; font-weight: 700; white-space: nowrap; }
.ms2-step.is-locked .ms2-step-label { color: var(--muted); }
.ms2-step-sub { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.ms2-step.is-active .ms2-step-sub { color: var(--ms2-accent); }
.ms2-step-conn { flex: 1; min-width: 18px; height: 2px; border-radius: 2px; background: rgba(255,255,255,.09); }
.ms2-step-conn.is-done { background: color-mix(in srgb, var(--ms2-accent) 50%, transparent); }

.ms2-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.ms2-stage-empty, .ms2-player-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); text-align: center; }
.ms2-spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255,255,255,.14); border-top-color: var(--ms2-accent); animation: ms2-spin .8s linear infinite; }
@keyframes ms2-spin { to { transform: rotate(360deg); } }
.ms2-empty-text { font-size: 13px; }

.ms2-card { border: 1px solid rgba(255,255,255,.1); border-radius: 16px; background: var(--card, #1a1a22); overflow: hidden; }
.ms2-card-head, .ms2-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.ms2-card-head { border-bottom: 1px solid var(--ms2-line); }
.ms2-stage-head { padding: 0 0 4px; flex-wrap: wrap; }
.ms2-stage-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ms2-card-title { font-size: 16px; font-weight: 800; }
.ms2-card-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.ms2-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 5px 9px; border-radius: 7px; }
.ms2-tag--ok { background: color-mix(in srgb, var(--ms2-accent) 16%, transparent); color: var(--ms2-accent); border: 1px solid color-mix(in srgb, var(--ms2-accent) 40%, transparent); }
.ms2-ic { display: inline-flex; align-items: center; }

.ms2-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 9px 16px; border-radius: 11px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; border: 1px solid transparent; }
.ms2-btn--primary { background: var(--ms2-accent); color: var(--ms2-on-accent); }
.ms2-btn--primary:disabled { opacity: .5; cursor: default; }
.ms2-btn--ghost { background: transparent; border-color: rgba(255,255,255,.16); color: var(--text); }
.ms2-btn--ghost:hover { border-color: var(--ms2-accent); color: var(--ms2-accent); }
.ms2-stage-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ТЗ */
.ms2-tz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--ms2-line); }
.ms2-tz-cell { background: var(--card, #1a1a22); padding: 13px 20px; }
.ms2-tz-key { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.ms2-tz-val { font-size: 13.5px; font-weight: 600; }
.ms2-tz-plan { padding: 16px 20px; }
.ms2-tz-plan-title { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.ms2-tz-scene { display: flex; gap: 12px; margin-bottom: 11px; }
.ms2-tz-scene-n { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--ms2-accent); flex: 0 0 22px; }
.ms2-tz-scene-label { font-size: 13px; font-weight: 700; }
.ms2-tz-scene-desc { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* раскадровка */
.ms2-board-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.ms2-board-card { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--ms2-line); border-radius: 12px; background: var(--card, #1a1a22); padding: 10px; }
.ms2-board-frame { position: relative; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; background: radial-gradient(125% 120% at 50% 0%, #20232b, #0e0f13 72%); display: flex; align-items: center; justify-content: center; padding: 12px; }
.ms2-board-n { position: absolute; top: 7px; left: 9px; font-size: 10px; color: rgba(255,255,255,.5); font-variant-numeric: tabular-nums; }
.ms2-board-caption { font-size: 13px; font-weight: 800; text-align: center; line-height: 1.1; }
.ms2-board-meta { display: flex; align-items: center; justify-content: space-between; }
.ms2-board-label { font-size: 12px; font-weight: 600; }
.ms2-board-dur { font-size: 10.5px; color: var(--muted); }
.ms2-lane-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ms2-lane-chip { font-size: 9px; font-weight: 700; letter-spacing: .05em; padding: 3px 6px; border-radius: 5px; background: rgba(255,255,255,.06); color: var(--muted); }

.ms2-costbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--ms2-line); border-radius: 13px; background: var(--card, #1a1a22); }
.ms2-cost-label { font-size: 12px; color: var(--muted); display: block; }
.ms2-cost-value { font-size: 18px; font-weight: 800; }
.ms2-cost-actions { display: flex; gap: 10px; }

/* видео */
.ms2-seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--ms2-line); }
.ms2-seg-btn { min-height: 44px; padding: 6px 13px; border: none; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ms2-seg--mono .ms2-seg-btn { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.ms2-seg-btn.is-active { background: var(--ms2-accent); color: var(--ms2-on-accent); }
.ms2-download { white-space: nowrap; }
.ms2-video-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.ms2-player-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.ms2-player { position: relative; max-width: 100%; max-height: 100%; height: 100%; border-radius: 16px; overflow: hidden; background: #0c0d11; box-shadow: 0 24px 70px rgba(0,0,0,.5), 0 0 0 1px var(--ms2-line); }
.ms2-video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.ms2-strip { flex: 0 0 auto; }
.ms2-strip-title { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.ms2-strip-track { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 5px; }
.ms2-strip-thumb { flex: 0 0 152px; position: relative; aspect-ratio: 16 / 9; border-radius: 10px; border: 1px solid var(--ms2-line); background: radial-gradient(125% 120% at 50% 0%, #20232b, #0e0f13 72%); color: var(--text); cursor: pointer; padding: 8px; display: flex; align-items: center; justify-content: center; text-align: center; }
.ms2-rail { flex: 0 0 158px; border-left: 1px solid var(--ms2-line); }
.ms2-rail-track { display: flex; flex-direction: column; gap: 11px; overflow-y: auto; }
.ms2-rail-thumb { position: relative; aspect-ratio: 9 / 16; border-radius: 11px; border: 1px solid var(--ms2-line); background: radial-gradient(125% 120% at 50% 0%, #20232b, #0e0f13 72%); color: var(--text); cursor: pointer; padding: 8px; display: flex; align-items: center; justify-content: center; text-align: center; }
.ms2-shell.is-cinema .ms2-video-body { flex-direction: row; }
.ms2-thumb-n { position: absolute; top: 6px; left: 8px; font-size: 10px; color: rgba(255,255,255,.55); font-variant-numeric: tabular-nums; }
.ms2-thumb-dur { position: absolute; bottom: 6px; right: 8px; font-size: 9.5px; color: rgba(255,255,255,.55); }
.ms2-thumb-cap { font-size: 11px; font-weight: 700; line-height: 1.15; }
.ms2-timeline-stub { flex: 0 0 auto; padding: 22px; text-align: center; color: var(--muted); border: 1px dashed var(--ms2-line); border-radius: 12px; }

/* ---- mobile tab switch (Чат | Стадия) ---- */
.ms2-tabs { display: none; }
.ms2-tab { flex: 1; min-height: 48px; border: none; background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }

@media (max-width: 1099px) {
  .ms2-shell.is-cinema .ms2-rail, .ms2-shell.is-cinema .ms2-video-body { display: block; }
  .ms2-rail { display: none; }
}
@media (max-width: 767px) {
  .ms2-shell {
    flex-direction: column;
    /* FooterNav is hidden for the studio on mobile (router), so only subtract the
       sticky mobile header — the studio's own Чат|Стадия tabs live inside the shell. */
    height: calc(100dvh - 60px);
  }
  .ms2-chat, .ms2-stage-col { flex: 1 1 auto; min-height: 0; }
  .ms2-shell[data-ms-pane="chat"] .ms2-stage-col { display: none; }
  .ms2-shell[data-ms-pane="stage"] .ms2-chat { display: none; }
  .ms2-chat { border-right: none; }
  .ms2-tabs {
    display: flex; flex: 0 0 auto;
    border-top: 1px solid var(--ms2-line);
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--ms2-panel);
  }
  .ms2-shell[data-ms-pane="chat"] .ms2-tab:first-child,
  .ms2-shell[data-ms-pane="stage"] .ms2-tab:last-child { color: var(--ms2-accent); box-shadow: inset 0 2px 0 var(--ms2-accent); }
  .ms2-tz-grid { grid-template-columns: 1fr; }
  .ms2-bubble { max-width: 92%; }
}

/* ---- Motion Studio: per-scene regenerate + reformat + timeline editor (R6) ---- */
.ms2-board-frame { position: relative; }
.ms2-board-regen {
  position: absolute; top: 6px; right: 6px;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.16); border-radius: 8px;
  background: rgba(10,11,14,.55); color: var(--text); cursor: pointer;
}
.ms2-board-regen:hover { border-color: var(--ms2-accent); color: var(--ms2-accent); }
.ms2-reformat { white-space: nowrap; }

.ms2-timeline { flex: 0 0 auto; position: relative; padding: 6px 2px 10px; }
.ms2-tl-ruler { display: flex; justify-content: space-between; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; color: var(--muted); margin-bottom: 6px; padding-left: 70px; }
.ms2-tl-lane { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ms2-tl-lane-label { flex: 0 0 62px; font-size: 10px; color: var(--muted); }
.ms2-tl-track { flex: 1; display: flex; gap: 3px; height: 44px; overflow-x: auto; }
.ms2-tl-scenes { height: 50px; }
.ms2-tl-block {
  flex-grow: 0; flex-shrink: 0; min-width: 44px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--ms2-accent) 40%, transparent); border-radius: 7px;
  background: color-mix(in srgb, var(--ms2-accent) 14%, transparent);
  color: var(--text); cursor: pointer; font: inherit; text-align: left;
}
.ms2-tl-block:hover { border-color: var(--ms2-accent); }
.ms2-tl-block-label { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms2-tl-block-dur { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 9.5px; color: var(--muted); }
.ms2-tl-track .ms2-tl-seg { flex-grow: 0; flex-shrink: 0; height: 100%; border-radius: 5px; border: 1px dashed rgba(255,255,255,.12); background: rgba(255,255,255,.03); }
.ms2-tl-seg.is-on { border-style: solid; border-color: color-mix(in srgb, var(--ms2-accent) 55%, transparent); background: color-mix(in srgb, var(--ms2-accent) 22%, transparent); }
.ms2-tl-seg.is-full { flex-basis: 100%; }
.ms2-tl-playhead { position: absolute; top: 24px; bottom: 10px; left: 0; width: 2px; background: var(--ms2-accent); box-shadow: 0 0 8px var(--ms2-accent); pointer-events: none; }
.ms2-spent { margin-left: auto; flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ms2-spent::before { content: ''; }

/* ---- Motion Studio: предвыбор шаблона (карточки в ЧАТЕ, превью в СТЕЙДЖЕ) ---- */
.ms2-stage--tpl { gap: 14px; }
/* слот выбора в чат-панели (под лентой, над композером) */
.ms2-chat-extra { flex: 0 0 auto; display: flex; flex-direction: column; gap: 11px; padding: 0 16px 12px; overflow-y: auto; max-height: 55%; }
.ms2-chat-extra:empty { display: none; }
.ms2-tpl-intro { display: flex; flex-direction: column; gap: 4px; padding: 2px 2px 4px; }
.ms2-tpl-intro-title { font-size: 14px; font-weight: 800; color: var(--text); }
.ms2-tpl-intro-text { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.ms2-tpl-cards { display: flex; flex-direction: column; gap: 11px; }
.ms2-tpl-continue { width: 100%; }
.ms2-tpl-card { display: flex; align-items: flex-start; gap: 11px; padding: 14px; border-radius: 14px; text-align: left; cursor: pointer; font: inherit; color: var(--text); background: var(--card, #1a1a22); border: 1px solid rgba(255,255,255,.08); }
.ms2-tpl-card.is-selected { border-color: color-mix(in srgb, var(--ms2-accent) 70%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ms2-accent) 40%, transparent); background: color-mix(in srgb, var(--ms2-accent) 10%, var(--card, #1a1a22)); }
.ms2-tpl-radio { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); }
.ms2-tpl-radio.is-on { border: 5px solid var(--ms2-accent); background: var(--bg, #0b0b0f); }
.ms2-tpl-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ms2-tpl-card-head { display: flex; align-items: center; gap: 8px; }
.ms2-tpl-name { font-size: 14px; font-weight: 800; }
.ms2-tpl-desc { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.ms2-tpl-preview { flex: 1; display: flex; gap: 22px; align-items: flex-start; padding: 8px 4px; }
.ms2-tpl-frame { flex: 0 0 190px; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center; padding: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.5), 0 0 0 1px var(--ms2-line); }
.ms2-tpl-preview.is-motion .ms2-tpl-frame { background: radial-gradient(125% 120% at 50% 0%, #20232b, #0c0d11 72%); }
.ms2-tpl-preview.is-ugc .ms2-tpl-frame { background: repeating-linear-gradient(135deg,#23262d 0 12px,#1c1f25 12px 24px); }
/* Family C (animation ad) — premium citrus/amber studio gradient preview frame. */
.ms2-tpl-preview.is-ad .ms2-tpl-frame { background: radial-gradient(130% 120% at 50% 0%, #3a2410, #120d08 74%); }
.ms2-tpl-preview.is-ad .ms2-tpl-frame-label { color: #ffcf8f; }
/* Family C — two concept boards to pick from (right stage pane). */
.ms2-variants-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.ms2-variant-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.03); box-shadow: 0 0 0 1px var(--ms2-line); }
.ms2-variant-img { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); }
.ms2-variant-label { font-size: 13px; font-weight: 700; color: #f4f6f4; text-align: center; }
.ms2-variant-pick { width: 100%; }
@media (max-width: 767px) { .ms2-variants-grid { grid-template-columns: 1fr; } }
.ms2-tpl-frame-label { font-size: 13px; font-weight: 800; color: #f4f6f4; letter-spacing: .02em; }
.ms2-tpl-preview.is-ugc .ms2-tpl-frame-label { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; color: rgba(255,255,255,.6); font-weight: 500; }
.ms2-tpl-specs { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ms2-tpl-spec-key { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.ms2-tpl-spec-val { font-size: 13px; font-weight: 600; }
@media (max-width: 767px) { .ms2-tpl-preview { flex-basis: 100%; } }

/* ===== Партнёрский кабинет: табы «Промокод | UTM» + таблица UTM-ссылок ===== */
.blogger-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
}
.blogger-tab-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  min-height: 40px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.blogger-tab-btn:hover { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.9); }
.blogger-tab-btn.active {
  background: #6C5CE7;
  border-color: #6C5CE7;
  color: #fff;
}
.blogger-tab-content { display: block; }

.blogger-utm-links { margin-top: 24px; }
.blogger-utm-table {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}
.blogger-utm-row {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 0.7fr 0.7fr 0.9fr;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.blogger-utm-row:first-child { border-top: none; }
.blogger-utm-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blogger-utm-row > span:nth-child(3),
.blogger-utm-row > span:nth-child(4),
.blogger-utm-row > span:nth-child(5) { text-align: right; font-variant-numeric: tabular-nums; }
.blogger-utm-row--head {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.blogger-utm-row--inactive { opacity: 0.5; }

@media (max-width: 767px) {
  .blogger-utm-row { grid-template-columns: 1.2fr 0.6fr 0.6fr 0.8fr; }
  .blogger-utm-row > span:nth-child(2) { display: none; }
}

/* === Motion Studio: live work progress (skeletons + synthetic status bar) === */
.ms2-work { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px; background: rgba(255, 255, 255, 0.03); }
.ms2-work-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ms2-work-title { font-weight: 600; font-size: 0.95rem; }
.ms2-work-elapsed { font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--ms2-accent, #7ef0c9); }
.ms2-work-sub { font-size: 0.82rem; opacity: 0.65; }
.ms2-work-retry { font-size: 0.82rem; color: #f0c674; background: rgba(240, 198, 116, 0.12); border: 1px solid rgba(240, 198, 116, 0.3); border-radius: 8px; padding: 6px 10px; }
.ms2-progress { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.ms2-progress-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--ms2-accent, #7ef0c9), #4cc8a3); transition: width 0.9s linear; }
.ms2-skeleton-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 4px; }
.ms2-skeleton-card { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.07); background: rgba(255, 255, 255, 0.04); overflow: hidden; display: flex; align-items: flex-end; padding: 10px; }
.ms2-skeleton-label { position: relative; z-index: 1; font-size: 0.8rem; opacity: 0.55; }
.ms2-skeleton-shine { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.09) 50%, transparent 70%); background-size: 220% 100%; animation: ms2-shimmer 1.6s ease-in-out infinite; }
@keyframes ms2-shimmer { 0% { background-position: 130% 0; } 100% { background-position: -90% 0; } }
.ms2-player-empty--work { display: flex; align-items: center; justify-content: center; padding: 20px; }
.ms2-player-empty--work .ms2-work { width: min(420px, 92%); }
.ms2-stage--variants .ms2-work { margin: 0 0 12px; }

/* === Motion Studio: static "boards will appear here" placeholder (C-only flow) === */
.ms2-stage-empty--static { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 240px; text-align: center; padding: 24px; }
.ms2-empty-title { font-weight: 600; font-size: 1rem; opacity: 0.85; }
.ms2-stage-empty--static .ms2-empty-text { opacity: 0.55; max-width: 420px; }

/* === Motion Studio: Family C product FORM (левая панель вместо чата) === */
.ms2-form-root { display: none; }
.ms2-chat--form .ms2-thread,
.ms2-chat--form .ms2-chat-extra,
.ms2-chat--form .ms2-composer { display: none; }
.ms2-chat--form .ms2-form-root { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; }
/* компактные метрики: весь путь «фото → поля → стиль → Создать» помещается в один экран */
/* position:relative ОБЯЗАТЕЛЕН: .ms2-form-study — absolute/inset:0, и без
   позиционированного предка он якорился к .ms2-shell (тоже relative) и
   растягивался на ВЕСЬ экран поверх правой панели (баг 2026-08-04). */
.ms2-form { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; }

/* фото продукта */
.ms2-form-photos { display: flex; flex-direction: column; gap: 8px; }
.ms2-form-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px; border: 1.5px dashed rgba(255,255,255,0.22); border-radius: 16px; background: rgba(255,255,255,0.03); color: inherit; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.ms2-form-drop:hover:not(:disabled) { border-color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.05); }
.ms2-form-drop:disabled { opacity: 0.55; cursor: default; }
.ms2-form-drop-plus { font-size: 2rem; line-height: 1; opacity: 0.7; }
.ms2-form-drop-title { font-weight: 600; }
.ms2-form-drop-sub { font-size: 0.8rem; opacity: 0.55; }
.ms2-form-photo { position: relative; border-radius: 16px; overflow: hidden; background: rgba(255,255,255,0.04); }
.ms2-form-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms2-form-photo--main { height: 180px; }
/* главное фото целиком (не кроп): продуктовые фото обычно на белом фоне */
.ms2-form-photo--main img { object-fit: contain; background: #fff; }
.ms2-form-thumbs { display: flex; gap: 8px; }
.ms2-form-thumbs .ms2-form-photo { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.ms2-form-add { width: 48px; height: 48px; border-radius: 12px; border: 1.5px dashed rgba(255,255,255,0.25); background: transparent; color: inherit; font-size: 1.4rem; cursor: pointer; flex: none; }
.ms2-form-add:hover:not(:disabled) { border-color: rgba(255,255,255,0.5); }
.ms2-form-add:disabled { opacity: 0.5; cursor: default; }

/* оверлей «Изучаем ваш продукт» / прогресс аплоада */
.ms2-form-study { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(10,10,14,0.88); backdrop-filter: blur(4px); text-align: center; padding: 16px; animation: ms2FormFade .25s ease; }
.ms2-form-study-title { font-weight: 700; font-size: 1.05rem; }
.ms2-form-study-sub { font-size: 0.85rem; opacity: 0.75; }
@keyframes ms2FormFade { from { opacity: 0; } to { opacity: 1; } }
.ms2-form-photos > .ms2-form-study { position: static; background: transparent; backdrop-filter: none; padding: 8px; }

/* поля */
.ms2-form-field { display: flex; flex-direction: column; gap: 4px; }
.ms2-form-label { font-size: 0.8rem; font-weight: 600; opacity: 0.65; text-transform: none; }
.ms2-form-input { width: 100%; border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; background: rgba(255,255,255,0.04); color: inherit; padding: 8px 10px; font: inherit; font-size: 0.88rem; }
.ms2-form-input:focus { outline: none; border-color: rgba(255,255,255,0.4); }
.ms2-form-input:disabled { opacity: 0.6; }
.ms2-form-textarea { resize: vertical; min-height: 56px; max-height: 96px; }

/* чипы стиля */
.ms2-form-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ms2-form-chip { border: 1px solid rgba(255,255,255,0.16); border-radius: 999px; background: rgba(255,255,255,0.04); color: inherit; padding: 4px 10px; font-size: 0.8rem; cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.ms2-form-chip:hover:not(:disabled) { border-color: rgba(255,255,255,0.4); }
.ms2-form-chip.is-on { background: var(--accent, #7c5cff); border-color: transparent; color: #fff; }
.ms2-form-chip:disabled { opacity: 0.55; cursor: default; }
.ms2-form-style-custom { margin-top: 2px; }

/* футер: цена + создать / статус производства */
.ms2-form-footer { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 6px; border-top: 1px solid rgba(255,255,255,0.08); }
.ms2-form-price { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.ms2-form-price-val { font-size: 1.15rem; }
.ms2-form-price-sub { font-size: 0.72rem; opacity: 0.55; line-height: 1.35; }
.ms2-form-create { width: 100%; padding: 10px; font-size: 0.95rem; }
.ms2-form-started { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; opacity: 0.9; }
.ms2-form-error { color: #e05555; font-size: 0.85rem; }

/* === Motion Studio C: «придумываю концепции» + повтор рендера === */
.ms2-spinner--inline { width: 16px; height: 16px; border-width: 2px; flex: none; }
.ms2-render-retry { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; }
.ms2-render-retry .ms2-empty-title { font-weight: 700; font-size: 1.05rem; }
.ms2-render-retry .ms2-empty-text { opacity: 0.65; max-width: 360px; }

/* === Хедер: пункт «Рекламная студия» с плашкой NEW === */
/* Абсолютный бейдж (top:-8px/right:-28px из базового правила) обрезается
   overflow:auto самой .header-nav — рендерим плашку инлайном рядом с текстом. */
.header-nav .nav-link-wrapper { display: inline-flex; align-items: center; gap: 6px; }
.header-nav .nav-link-wrapper .nav-badge { position: static; transform: translateY(-5px); }

/* === «Говорящая голова»: пикер голоса с прослушиванием семплов === */
.voice-picker-wrapper { margin-bottom: 16px; }
.voice-picker-hint {
  font-size: 13px;
  color: var(--text-secondary, #9ca3af);
  margin: 4px 0 10px;
}
.voice-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.voice-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  min-height: 56px;
  border: 1px solid var(--border-color, #374151);
  border-radius: 12px;
  background: var(--bg-secondary, #1f2937);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.voice-card:hover { border-color: var(--accent-color, #8b5cf6); }
.voice-card.selected {
  border-color: var(--accent-color, #8b5cf6);
  background: rgba(139, 92, 246, 0.12);
}
.voice-card:focus-visible {
  outline: 2px solid var(--accent-color, #8b5cf6);
  outline-offset: 2px;
}
.voice-play-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color, #374151);
  background: var(--bg-primary, #111827);
  color: var(--text-primary, #f9fafb);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.voice-play-btn:hover { border-color: var(--accent-color, #8b5cf6); }
.voice-play-btn.playing {
  background: var(--accent-color, #8b5cf6);
  border-color: var(--accent-color, #8b5cf6);
  color: #fff;
}
.voice-card-info { min-width: 0; }
.voice-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #f9fafb);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-card-tag {
  font-size: 12px;
  color: var(--text-secondary, #9ca3af);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 480px) {
  .voice-picker-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Счётчик символов textarea (текст озвучки) */
.textarea-counter {
  font-size: 12px;
  color: var(--text-secondary, #9ca3af);
  text-align: right;
  margin-top: 4px;
}

/* === «Говорящая голова»: пикер голоса v2 — выпадающий список + лаймовый акцент === */
.voice-picker { position: relative; }
.voice-picker-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  min-height: 56px;
  border: 1px solid var(--border-color, #374151);
  border-radius: 12px;
  background: var(--bg-secondary, #1f2937);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.voice-picker-toggle:hover,
.voice-picker-toggle.open { border-color: #b4ff39; }
.voice-picker-toggle:focus-visible {
  outline: 2px solid #b4ff39;
  outline-offset: 2px;
}
.voice-picker-arrow {
  margin-left: auto;
  color: var(--text-secondary, #9ca3af);
  font-size: 14px;
  transition: transform 0.15s ease;
}
.voice-picker-toggle.open .voice-picker-arrow { transform: rotate(180deg); }
.voice-picker-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border-color, #374151);
  border-radius: 12px;
  background: var(--bg-primary, #111827);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.voice-picker-dropdown.active { display: block; }
.voice-picker-dropdown .voice-card { margin-bottom: 6px; }
.voice-picker-dropdown .voice-card:last-child { margin-bottom: 0; }

/* Лаймовый акцент вместо фиолетового (основной цвет главной, #b4ff39) */
.voice-card:hover { border-color: #b4ff39; }
.voice-card.selected {
  border-color: #b4ff39;
  background: rgba(180, 255, 57, 0.10);
}
.voice-card:focus-visible {
  outline: 2px solid #b4ff39;
  outline-offset: 2px;
}
.voice-play-btn:hover { border-color: #b4ff39; }
.voice-play-btn.playing {
  background: #b4ff39;
  border-color: #b4ff39;
  color: #111827;
}

/* === Motion Studio Family G «Видео под музыку»: УТП-строки + музыкальные пресеты === */
.ms2-form-usps .ms2-form-usp { margin-bottom: 8px; }
.ms2-form-usps .ms2-form-chips { margin-top: 2px; }
.ms2-form-music-list { display: flex; flex-direction: column; gap: 8px; }
.ms2-form-music-row { display: flex; align-items: stretch; gap: 8px; }
.ms2-form-music-card { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; background: rgba(255,255,255,0.04); color: inherit; padding: 10px 12px; cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.ms2-form-music-card:hover:not(:disabled) { border-color: rgba(255,255,255,0.4); }
.ms2-form-music-card.is-on { border-color: #b4ff39; background: rgba(180,255,57,0.08); }
.ms2-form-music-card:disabled { opacity: 0.55; cursor: default; }
.ms2-form-music-title { font-weight: 600; font-size: 0.9rem; }
.ms2-form-music-mood { font-size: 0.78rem; opacity: 0.65; }
.ms2-form-music-play { min-width: 44px; min-height: 44px; border: 1px solid rgba(255,255,255,0.16); border-radius: 12px; background: rgba(255,255,255,0.04); color: inherit; font-size: 0.85rem; cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.ms2-form-music-play:hover { border-color: rgba(255,255,255,0.4); }
.ms2-form-music-play.is-playing { background: #b4ff39; border-color: #b4ff39; color: #111827; }

/* === Motion Studio: «Как вам видео?» — оценка готового ролика под плеером === */
.ms2-feedback { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 12px 4px; text-align: center; }
.ms2-feedback-title { font-weight: 600; font-size: 0.95rem; }
.ms2-feedback-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ms2-feedback-btn { min-height: 44px; min-width: 44px; padding: 10px 16px; }
.ms2-feedback-btn:disabled { opacity: 0.55; cursor: default; }
.ms2-feedback-btn--good:hover:not(:disabled) { border-color: #b4ff39; color: #b4ff39; }
.ms2-feedback-btn--bad:hover:not(:disabled) { border-color: #ff6b6b; color: #ff6b6b; }
.ms2-feedback--thanks { padding: 16px 12px 6px; color: var(--muted); font-size: 0.9rem; }

/* === Motion Studio Family H «Маркетплейсы»: ссылочная форма (2026-07-31) === */
.ms2-form-import-row { display: flex; gap: 8px; align-items: stretch; }
.ms2-form-import-row .ms2-form-input { flex: 1 1 auto; min-width: 0; }
.ms2-form-import-btn { flex: 0 0 auto; white-space: nowrap; min-height: 44px; padding: 0 16px; }

/* ============================================
   Подсказки select-параметров под гридом настроек (2026-08-21)
   Рендер: GenerationForm.renderSettingsSection → .settings-hints
   ============================================ */
.settings-hints {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.settings-hints .param-description {
  font-size: 12px;
}
