/* ── Motion Clone — Mobile bottom bar (<1200px) ───────────────── */

@media (max-width: 1199px) {

/* Скрываем скроллбар истории */
.screen-motion .gen-history {
  scrollbar-width: none;
}
.screen-motion .gen-history::-webkit-scrollbar {
  display: none;
}
/* Отступ снизу чтобы карточки не перекрывал бар */
.screen-motion .gen-history-wrap {
  padding-bottom: 240px;
}

/* ── Фиксированный бар снизу ──────────────────────────────────── */
.mc-input-card {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 16px 20px;
  background: var(--bg-card);
  border-top: 1px solid rgba(236,72,153,0.18);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 28px rgba(0,0,0,0.28);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.mc-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.mc-card-icon {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: rgba(236,72,153,0.12);
  border: 1px solid rgba(236,72,153,0.25);
  color: #ec4899;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mc-card-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(236,72,153,0.07);
  border: 1px solid rgba(236,72,153,0.16);
}
.mc-upload-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mc-upload-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mc-slot-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.mc-upload-slot {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 12px;
  border: 1.5px dashed rgba(236,72,153,0.28);
  background: rgba(236,72,153,0.03);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.18s, background 0.18s;
}
.mc-upload-slot:hover {
  border-color: rgba(236,72,153,0.5);
  background: rgba(236,72,153,0.06);
}
.mc-slot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
  color: rgba(236,72,153,0.5);
  padding: 8px;
  text-align: center;
}
.mc-slot-hint {
  font-size: 0.58rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.mc-slot-preview-img,
.mc-slot-preview-video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.mc-slot-remove {
  position: absolute;
  top: 5px; right: 5px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: none; color: #fff;
  font-size: 0.85rem; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: background 0.15s;
  padding: 0;
}
.mc-slot-remove:hover { background: rgba(239,68,68,0.85); }
.mc-video-loading {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 0.66rem;
  pointer-events: none;
}
.mc-video-loading-spin {
  width: 18px; height: 18px;
  border: 2px solid rgba(236,72,153,0.2);
  border-top-color: #ec4899;
  border-radius: 50%;
  animation: mc-spin 0.7s linear infinite;
}
@keyframes mc-spin { to { transform: rotate(360deg); } }
.mc-video-name {
  font-size: 0.6rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  min-height: 11px;
}
.mc-bottom-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mc-quality-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.mc-quality-switch {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px;
}
.mc-quality-btn {
  padding: 3px 10px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mc-quality-btn.active {
  background: rgba(236,72,153,0.16);
  color: #ec4899;
  box-shadow: 0 0 0 1px rgba(236,72,153,0.28);
}
.mc-quality-btn:not(.active):hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
.mc-input-card .gen-submit-row-desktop {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}
#mc-submit {
  flex: 1;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ec4899, #db2777);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: opacity 0.15s, box-shadow 0.15s;
}
#mc-submit:not(:disabled):hover {
  box-shadow: 0 6px 20px rgba(236,72,153,0.4);
  opacity: 0.92;
}
#mc-submit:disabled {
  opacity: 0.38;
  cursor: default;
}
#mc-submit .price {
  margin-left: 5px;
  opacity: 0.85;
  font-size: 0.8em;
}
#mc-msg.msg:empty { display: none; }
#mc-msg.msg {
  font-size: 0.75rem;
  color: var(--text-muted);
}

} /* end @media (max-width: 1199px) */

/* ── Motion Clone — Desktop styles (≥1200px) ──────────────────── */

@media (min-width: 1200px) {

/* ── Full-screen layout (копирует screen-video) ───────────────── */
body.web-mode.screen-motion {
  height: 100vh;
  overflow: hidden;
}
body.web-mode.screen-motion .wrap {
  flex-direction: row;
  height: 100vh;
  overflow: hidden;
}
body.web-mode.screen-motion #app {
  flex: 1;
  padding: 0;
  max-width: none;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Grid: история сверху, карточка снизу ─────────────────────── */
body.web-mode.screen-motion .gen-page {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
  grid-template-areas:
    "main"
    "card";
  flex: 1;
  height: auto;
  max-height: none;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}
body.web-mode.screen-motion .gen-main {
  grid-area: main;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.web-mode.screen-motion .gen-history-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding: 20px 24px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  scrollbar-gutter: stable;
}
body.web-mode.screen-motion .gen-history {
  flex: none;
  overflow: visible;
  height: auto;
  max-height: none;
  gap: 8px;
  grid-template-columns: repeat(6, minmax(176px, 1fr));
  grid-auto-rows: auto;
  align-content: start;
}
/* Пустое состояние — центрируем */
body.web-mode.screen-motion .gen-history:has(.gen-history-empty) {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.web-mode.screen-motion .gen-history .hist-card {
  aspect-ratio: 1;
  min-height: 0;
  width: 100%;
  border-radius: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
body.web-mode.screen-motion .gen-history .hist-card.hist-card-video:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 28px rgba(236,72,153,0.2);
  border-color: rgba(236,72,153,0.3);
  z-index: 2;
}

/* ── Input card — переопределяем body.web-mode .gen-input-card { padding:0 } ── */
body.web-mode .mc-input-card {
  grid-area: card;
  max-width: 840px;
  width: calc(100% - 48px);
  margin: 0 auto 16px;
  padding: 18px 24px 16px;      /* <-- правильный padding, побеждает layout.css */
  border-radius: 22px;
  background: var(--bg);
  border: 1px solid rgba(236,72,153,0.18);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.18),
    0 8px 32px rgba(0,0,0,0.14),
    0 0 0 1px rgba(236,72,153,0.05);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}
body.web-mode .mc-input-card:focus-within {
  border-color: rgba(236,72,153,0.32);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.18),
    0 8px 32px rgba(236,72,153,0.1),
    0 0 0 1px rgba(236,72,153,0.1);
}

/* ── Заголовок карточки ──────────────────────────────────────── */
.mc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.mc-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}
.mc-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(236,72,153,0.12);
  border: 1px solid rgba(236,72,153,0.25);
  color: #ec4899;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mc-card-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(236,72,153,0.07);
  border: 1px solid rgba(236,72,153,0.16);
}

/* ── Upload row: два слота рядом ─────────────────────────────── */
.mc-upload-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mc-upload-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.mc-slot-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

/* ── Upload slot ─────────────────────────────────────────────── */
.mc-upload-slot {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 14px;
  border: 1.5px dashed rgba(236,72,153,0.28);
  background: rgba(236,72,153,0.03);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.mc-upload-slot:hover {
  border-color: rgba(236,72,153,0.55);
  background: rgba(236,72,153,0.06);
  box-shadow: 0 0 0 3px rgba(236,72,153,0.07);
}
.mc-slot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  color: rgba(236,72,153,0.5);
  padding: 12px;
  text-align: center;
}
.mc-slot-hint {
  font-size: 0.67rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.mc-slot-preview-img,
.mc-slot-preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mc-slot-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: none;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s;
  padding: 0;
}
.mc-slot-remove:hover { background: rgba(239,68,68,0.85); }

/* ── Video loading spinner ───────────────────────────────────── */
.mc-video-loading {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.72rem;
  pointer-events: none;
}
.mc-video-loading-spin {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(236,72,153,0.2);
  border-top-color: #ec4899;
  border-radius: 50%;
  animation: mc-spin 0.7s linear infinite;
}
@keyframes mc-spin { to { transform: rotate(360deg); } }

.mc-video-name {
  font-size: 0.67rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  min-height: 14px;
}

/* ── Нижняя строка: качество + кнопка ───────────────────────── */
.mc-bottom-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mc-quality-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.mc-quality-switch {
  display: flex;
  gap: 3px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.mc-quality-btn {
  padding: 4px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.mc-quality-btn.active {
  background: rgba(236,72,153,0.16);
  color: #ec4899;
  box-shadow: 0 0 0 1px rgba(236,72,153,0.28);
}
.mc-quality-btn:not(.active):hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

/* ── Submit row ──────────────────────────────────────────────── */
body.web-mode .mc-input-card .gen-submit-row-desktop {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  padding: 0;
}
body.web-mode .mc-input-card .gen-submit-row-desktop .chat-submit {
  min-width: 240px;
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: opacity 0.15s, box-shadow 0.15s, transform 0.1s;
  white-space: nowrap;
  background: linear-gradient(135deg, #ec4899, #db2777);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: inherit;
  width: auto;
}
body.web-mode .mc-input-card .gen-submit-row-desktop .chat-submit:not(:disabled):hover {
  box-shadow: 0 8px 24px rgba(236,72,153,0.4);
  opacity: 0.92;
}
body.web-mode .mc-input-card .gen-submit-row-desktop .chat-submit:not(:disabled):active {
  transform: scale(0.98);
}
body.web-mode .mc-input-card .gen-submit-row-desktop .chat-submit:disabled {
  opacity: 0.38;
  cursor: default;
}
body.web-mode .mc-input-card .gen-submit-row-desktop .chat-submit .price {
  margin-left: 6px;
  opacity: 0.85;
  font-size: 0.82em;
}
body.web-mode .mc-input-card .msg:empty { display: none; }
body.web-mode .mc-input-card .msg {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex: 1;
}

/* ── History hover / empty state ─────────────────────────────── */
.mc-empty-glow {
  background: radial-gradient(circle at 50% 50%, rgba(236,72,153,0.12), transparent 68%);
}
.mc-empty-icon-wrap {
  background: rgba(236,72,153,0.07);
  border-color: rgba(236,72,153,0.18);
  box-shadow: 0 8px 28px rgba(236,72,153,0.1);
  animation-delay: 0.2s;
}

/* ── Nav item motion accent ──────────────────────────────────── */
.pc-nav-item-motion .pc-nav-icon {
  background: rgba(236,72,153,0.06);
  border-color: rgba(236,72,153,0.18);
  color: #ec4899;
}
.pc-nav-item-motion:hover .pc-nav-icon,
.pc-nav-item-motion.active .pc-nav-icon {
  background: rgba(236,72,153,0.14);
  border-color: rgba(236,72,153,0.38);
}
.pc-nav-item-motion.active {
  background: rgba(236,72,153,0.08);
  color: #ec4899;
}
.pc-nav-item-motion.active .pc-nav-sub { color: rgba(236,72,153,0.65); }
.pc-nav-item-motion.active::before { background: #ec4899; }

} /* end @media (min-width: 1200px) */

/* ── Light theme overrides ───────────────────────────────────── */
[data-theme="light"] .mc-upload-slot {
  background: rgba(236,72,153,0.02);
  border-color: rgba(236,72,153,0.22);
}
[data-theme="light"] .mc-upload-slot:hover {
  background: rgba(236,72,153,0.05);
}
[data-theme="light"] .mc-quality-switch {
  background: rgba(0,0,0,0.03);
}
[data-theme="light"] .mc-input-card {
  background: #fff;
  border-color: rgba(236,72,153,0.2);
}
