/* THE DOM PROTOCOL - Ultra Premium Interface v4.0 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #000000;
  color: #ffffff;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 40px 30px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* ═══ Star Field ═══ */

.stars-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 1px;
  height: 1px;
  background: #e8e4dc;
  border-radius: 50%;
  opacity: 0.2;
  animation: twinkle var(--tw-dur, 3s) ease-in-out var(--tw-delay, 0s) infinite;
}

.star--medium {
  width: 1.5px;
  height: 1.5px;
  opacity: 0.35;
}

.star--bright {
  width: 2px;
  height: 2px;
  opacity: 0.5;
  box-shadow: 0 0 4px rgba(232, 228, 220, 0.3);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.6; }
}

/* ═══ Shooting Stars ═══ */

.shooting-star {
  position: fixed;
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, rgba(232, 228, 220, 0.7), transparent);
  border-radius: 1px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  animation: shoot var(--shoot-dur, 0.8s) linear var(--shoot-delay, 0s) forwards;
  transform-origin: left center;
  transform: rotate(var(--shoot-angle, -35deg));
  top: var(--shoot-y, 20%);
  left: var(--shoot-x, 50%);
}

.shooting-star::before {
  content: '';
  position: absolute;
  right: 0;
  top: -1px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px 2px rgba(232, 228, 220, 0.5);
}

@keyframes shoot {
  0% { opacity: 0; transform: rotate(var(--shoot-angle, -35deg)) translateX(0); }
  10% { opacity: 1; }
  70% { opacity: 0.6; }
  100% { opacity: 0; transform: rotate(var(--shoot-angle, -35deg)) translateX(300px); }
}


/* ═══ Splash Screen ═══ */

.splash {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.splash-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 228, 220, 0.06) 0%, rgba(232, 228, 220, 0.02) 40%, transparent 70%);
  filter: blur(80px);
  animation: splash-glow-pulse 4s ease-in-out infinite;
}

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

.splash-content {
  position: relative;
  text-align: center;
}

.splash-credit {
  position: absolute;
  font-size: 0.45rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: #a09a90;
  opacity: 0;
  animation: splash-fade-in 0.6s ease-out 0.2s forwards;
  transition: none;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

.splash-title {
  font-size: 7rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  color: #ffffff;
  text-shadow: 0 0 60px rgba(255, 255, 255, 0.1), 0 0 120px rgba(232, 228, 220, 0.05);
  opacity: 0;
  animation: splash-title-reveal 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
}

.splash-title .splash-letter:last-child {
  margin-right: -0.25em;
}

@media (min-width: 768px) {
  .splash-title {
    font-size: 9rem;
  }
}

.splash-letter {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.3s ease,
              text-shadow 0.3s ease,
              filter 0.3s ease;
  cursor: default;
}

.splash-letter:hover {
  transform: translateY(-8px) scale(1.08);
  color: #ffffff;
  text-shadow:
    0 0 20px rgba(232, 228, 220, 0.6),
    0 0 60px rgba(232, 228, 220, 0.2),
    0 4px 15px rgba(0, 0, 0, 0.5);
  filter: brightness(1.3);
}

.splash-letter:active {
  transform: translateY(-2px) scale(1.02);
}

.splash-line {
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 228, 220, 0.6), transparent);
  margin: 20px auto;
  transform: scaleX(0);
  animation: splash-line-expand 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1s forwards;
}

.splash-subtitle {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.4em;
  color: #a09a90;
  opacity: 0;
  animation: splash-fade-in 0.6s ease-out 1.3s forwards;
}

.splash-btn {
  margin-top: 60px;
  padding: 14px 44px;
  background: transparent;
  border: 1px solid rgba(232, 228, 220, 0.15);
  color: #e8e4dc;
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  cursor: pointer;
  opacity: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.3s, color 0.3s, box-shadow 0.3s, background 0.3s;
  animation: splash-btn-appear 0.5s ease-out 1.8s forwards, splash-btn-glow 3s ease-in-out 2.3s infinite;
  position: relative;
  overflow: hidden;
}

.splash-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(232, 228, 220, 0.06), transparent);
  animation: btn-shimmer 4s ease-in-out 2.5s infinite;
}

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

.splash-btn:hover {
  border-color: rgba(232, 228, 220, 0.5);
  color: #ffffff;
  background: rgba(232, 228, 220, 0.04);
  box-shadow: 0 0 40px rgba(232, 228, 220, 0.1), inset 0 0 20px rgba(232, 228, 220, 0.02);
}

.splash-btn:active {
  transform: scale(0.97);
}

.splash-btn-icon {
  font-size: 0.75rem;
  animation: icon-pulse 2s ease-in-out 2s infinite;
}

@keyframes icon-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; text-shadow: 0 0 8px rgba(232, 228, 220, 0.3); }
}

.splash-exit {
  animation: splash-fade-out 0.5s ease-in forwards;
}

/* ═══ Lightning Flash ═══ */

.lightning-flash {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.9) 0%, rgba(232, 228, 220, 0.3) 40%, transparent 70%);
}

.lightning-flash.flash-active {
  animation: lightning 0.6s ease-out forwards;
}

@keyframes lightning {
  0% { opacity: 0; }
  8% { opacity: 1; }
  15% { opacity: 0.3; }
  22% { opacity: 0.8; }
  35% { opacity: 0.1; }
  50% { opacity: 0.4; }
  100% { opacity: 0; }
}

@keyframes splash-title-reveal {
  0% { opacity: 0; letter-spacing: 0.6em; filter: blur(6px); }
  60% { opacity: 1; letter-spacing: 0.22em; filter: blur(0); }
  100% { opacity: 1; letter-spacing: 0.25em; filter: blur(0); }
}

@keyframes splash-line-expand {
  0% { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}

@keyframes splash-fade-in {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes splash-btn-appear {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes splash-btn-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(232, 228, 220, 0.03); }
  50% { box-shadow: 0 0 30px rgba(232, 228, 220, 0.08); }
}

@keyframes splash-fade-out {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ═══ App Enter Animation ═══ */

.app-enter {
  animation: app-content-enter 0.5s ease-out forwards;
}

@keyframes app-content-enter {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Header (legacy, no longer rendered) */
header {
  display: none;
}

/* header-credit only used in splash now */
.header-credit {
  display: none;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e8e4dc;
  margin-bottom: 40px;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tab-nav-left {
  display: flex;
  align-items: center;
  padding: 14px 0;
  margin-right: 20px;
  white-space: nowrap;
}

.tab-brand {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: #ffffff;
}

.tab-banana {
  font-size: 0.9rem;
  margin-left: 6px;
  filter: saturate(0.7) brightness(0.9);
  opacity: 0.7;
  transition: opacity 0.2s, filter 0.2s, transform 0.2s;
}

.tab-banana:hover {
  opacity: 1;
  filter: saturate(1) brightness(1);
  transform: rotate(-10deg) scale(1.1);
}

/* Nav balance (no box, green value) */
.nav-balance {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.nav-balance.hidden {
  display: none;
}

.nav-balance-value {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: #7aff8c;
}

.tab-nav-tabs {
  display: flex;
  flex: 1;
}

.tab-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 20px;
  white-space: nowrap;
}

.tab-btn {
  flex: 1;
  padding: 14px 20px;
  background: transparent;
  border: none;
  color: #a09a90;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  text-align: center;
  position: relative;
}

.tab-btn:hover {
  color: #e8e4dc;
}

.tab-btn.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: #e8e4dc;
  animation: tab-indicator 0.3s ease-out forwards;
}

@keyframes tab-indicator {
  0% { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}

.tab-btn.tab-disabled {
  color: #5a5550;
}

.tab-btn.tab-disabled.active {
  color: #6a6560;
}

.tab-x {
  color: #8b3030;
  font-size: 0.7em;
  margin-left: 2px;
}

.tab-unavailable {
  text-align: center;
  padding: 20px 0 0;
}

.unavailable-text {
  display: inline-block;
  color: #8b3030;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  font-weight: 500;
  border: 1px solid #3a2020;
  padding: 8px 16px;
}

/* Tab Panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 50px;
  flex: 1;
}

@media (max-width: 1000px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Balance Display (legacy, hidden in new nav) */
.balance-display {
  display: none;
}

.balance-display.hidden {
  display: none;
}

.balance-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.balance-label {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: #a09a90;
}

.balance-value {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: #7aff8c;
}

.balance-refresh {
  background: none;
  border: none;
  color: #a09a90;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 4px;
  transition: color 0.2s;
  line-height: 1;
}

.balance-refresh.hidden {
  display: none;
}

.balance-refresh:hover {
  color: #ffffff;
}

/* Sections */
.section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: #e8e4dc;
  margin-bottom: 5px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.label-hint {
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #a09a90;
  margin-left: 8px;
}

/* Upload Zones */
.upload-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.upload-label {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: #e8e4dc;
}

.upload-zone {
  position: relative;
  border: 1px solid #e8e4dc;
  background: transparent;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.upload-zone:hover {
  border-color: #ffffff;
}

.upload-zone.drag-over {
  border-color: #ffffff;
  box-shadow: 0 0 20px rgba(232, 228, 220, 0.25);
}

.upload-zone input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.upload-zone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-zone video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-zone.has-image {
  border-color: #e8e4dc;
}

.upload-zone .upload-clear-btn {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s;
}

.upload-zone .upload-clear-btn:hover {
  background: rgba(255,255,255,0.2);
}

.upload-zone.has-image .upload-clear-btn {
  display: block;
}

.upload-zone.has-image:hover .upload-clear-btn {
  opacity: 1;
}

.upload-zone .upload-expand-btn {
  display: none;
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s;
}

.upload-zone .upload-expand-btn:hover {
  background: rgba(255,255,255,0.2);
}

.upload-zone.has-image .upload-expand-btn {
  display: block;
}

.upload-zone.has-image:hover .upload-expand-btn {
  opacity: 1;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.upload-text {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: #e8e4dc;
}

.upload-subtext {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: #a09a90;
}

/* Controls */
.control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group.full {
  grid-column: 1 / -1;
}

.control-group label {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: #e8e4dc;
}

select {
  width: 100%;
  padding: 12px 15px;
  background: #000000;
  border: 1px solid #e8e4dc;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  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='%23e8e4dc' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

select:hover {
  border-color: #ffffff;
}

select:focus {
  outline: none;
  border-color: #ffffff;
}

select option {
  background: #0a0a0a;
  color: #ffffff;
}

textarea {
  width: 100%;
  padding: 12px 15px;
  background: #000000;
  border: 1px solid #e8e4dc;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s;
}

textarea::placeholder {
  color: #a09a90;
  letter-spacing: 0.05em;
}

textarea:hover {
  border-color: #ffffff;
}

textarea:focus {
  outline: none;
  border-color: #ffffff;
}

/* Generate Button */
.generate-btn {
  width: 100%;
  padding: 16px 20px;
  background: #000000;
  border: 1px solid #e8e4dc;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
}

.generate-btn:hover:not(:disabled) {
  background: #0a0e1a;
  border-color: #ffffff;
  color: #ffffff;
}

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

.generate-btn .banana {
  margin-left: 8px;
}

/* Progress */
.progress-container {
  display: none;
  margin-top: 20px;
}

.progress-container.active {
  display: block;
}

.progress-bar {
  height: 1px;
  background: #3a3a3a;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #e8e4dc, #ffffff);
  width: 0%;
  transition: width 0.3s ease;
}

.status-text {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: #e8e4dc;
  margin-top: 12px;
  text-align: center;
}

/* Text Button */
.text-btn {
  background: none;
  border: none;
  color: #e8e4dc;
  font-family: inherit;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: color 0.2s;
}

.text-btn:hover {
  color: #ffffff;
}

/* Targets Upload */
.targets-section {
  flex: 0;
}

.targets-toggle {
  background: transparent;
  border: 1px solid rgba(232, 228, 220, 0.25);
  color: #a09a90;
  font-family: inherit;
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  padding: 8px 16px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.targets-toggle:hover {
  color: #e8e4dc;
  border-color: rgba(232, 228, 220, 0.5);
}

.targets-upload {
  position: relative;
  border: 1px solid #e8e4dc;
  background: transparent;
  padding: 50px 30px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 25px;
}

.targets-upload:hover {
  border-color: #ffffff;
}

.targets-upload.drag-over {
  border-color: #ffffff;
  box-shadow: 0 0 30px rgba(232, 228, 220, 0.15);
}

.targets-upload input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  top: 0;
  left: 0;
}

/* Targets Grid */
.targets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.target-item {
  position: relative;
  aspect-ratio: 9/16;
  border: 1px solid #e8e4dc;
  overflow: hidden;
  background: #050505;
}

.target-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.target-item .remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #e8e4dc;
  color: #e8e4dc;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}

.target-item:hover .remove-btn {
  opacity: 1;
}

.target-item .remove-btn:hover {
  color: #ffffff;
  border-color: #ffffff;
}

.status-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-align: center;
  background: rgba(0, 0, 0, 0.85);
}

.status-badge.pending {
  color: #a09a90;
}

.status-badge.processing {
  color: #7ab8ff;
}

.status-badge.success {
  color: #7aff8c;
}

.status-badge.error {
  color: #ff7a7a;
}

/* Results Section */
.results-section {
  display: none;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid #e8e4dc;
}

.results-section.active {
  display: block;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.result-item {
  position: relative;
  aspect-ratio: 9/16;
  border: 1px solid #e8e4dc;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
  background: #050505;
}

.result-item:hover {
  border-color: #ffffff;
}

.result-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-item.result-video {
  aspect-ratio: 16/9;
}

.result-item .download-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #e8e4dc;
  color: #e8e4dc;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}

.result-item:hover .download-btn {
  opacity: 1;
}

.result-item .download-btn:hover {
  color: #ffffff;
  border-color: #ffffff;
}

/* Multi-Prompt (Gemini) */
.prompts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prompt-entry {
  position: relative;
  display: flex;
  gap: 0;
}

.prompt-entry textarea {
  flex: 1;
  min-height: 60px;
}

.prompt-entry.prompt-failed textarea {
  border-color: #ff7a7a;
  box-shadow: inset 0 0 0 1px rgba(255, 122, 122, 0.3);
}
.prompt-entry.prompt-failed::before {
  content: '✕';
  position: absolute;
  top: 4px;
  left: 6px;
  color: #ff7a7a;
  font-size: 0.6rem;
  font-weight: 700;
  z-index: 1;
  pointer-events: none;
}

.prompt-entry.prompt-success textarea {
  border-color: #7aff8c;
  box-shadow: inset 0 0 0 1px rgba(122, 255, 140, 0.2);
}
.prompt-entry.prompt-success::before {
  content: '✓';
  position: absolute;
  top: 4px;
  left: 6px;
  color: #7aff8c;
  font-size: 0.6rem;
  font-weight: 700;
  z-index: 1;
  pointer-events: none;
}

.prompt-remove {
  width: 30px;
  background: transparent;
  border: 1px solid #e8e4dc;
  border-left: none;
  color: #a09a90;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.prompt-remove:hover {
  color: #ff7a7a;
  background: rgba(255, 122, 122, 0.1);
}

.prompt-add {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px dashed #3a3a3a;
  color: #a09a90;
  font-family: inherit;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.prompt-add:hover {
  border-color: #e8e4dc;
  color: #e8e4dc;
}

/* Preset prompt button */
.preset-btn {
  float: right;
  cursor: pointer;
  filter: saturate(0.7) brightness(0.9);
  opacity: 0.7;
  transition: opacity 0.2s, filter 0.2s, transform 0.2s;
}
.preset-btn:hover {
  opacity: 1;
  filter: saturate(1) brightness(1);
  transform: rotate(-10deg) scale(1.1);
}

/* Batch Selector (Seedream) */
.batch-selector {
  display: flex;
  gap: 0;
}

.batch-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: 1px solid #e8e4dc;
  color: #a09a90;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.batch-btn + .batch-btn {
  border-left: none;
}

.batch-btn:hover {
  color: #e8e4dc;
}

.batch-btn.active {
  background: rgba(232, 228, 220, 0.1);
  color: #ffffff;
}

/* Mode Toggle (Kling) */
.mode-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
}

.toggle-btn {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid #e8e4dc;
  color: #a09a90;
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.toggle-btn + .toggle-btn {
  border-left: none;
}

.toggle-btn:hover {
  color: #e8e4dc;
}

.toggle-btn.active {
  background: rgba(232, 228, 220, 0.1);
  color: #ffffff;
}

/* Duration Selector */
.duration-selector {
  display: flex;
  gap: 0;
}

.duration-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: 1px solid #e8e4dc;
  color: #a09a90;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.duration-btn + .duration-btn {
  border-left: none;
}

.duration-btn:hover {
  color: #e8e4dc;
}

.duration-btn.active {
  background: rgba(232, 228, 220, 0.1);
  color: #ffffff;
}

/* Orientation Selector */
.orientation-selector {
  display: flex;
  gap: 0;
}

.orientation-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: 1px solid #e8e4dc;
  color: #a09a90;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.orientation-btn + .orientation-btn {
  border-left: none;
}

.orientation-btn:hover {
  color: #e8e4dc;
}

.orientation-btn.active {
  background: rgba(232, 228, 220, 0.1);
  color: #ffffff;
}

/* Engine Tab Content Sections */
.engine-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.engine-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 30px;
  align-items: start;
}

.engine-upload-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.engine-upload-col > label,
.upload-col-label {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: #e8e4dc;
}

.upload-col-label {
  margin-top: 15px;
}

.engine-settings-col {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.engine-settings-col .generate-btn {
  margin-top: 5px;
}

.engine-settings-col textarea {
  min-height: 70px;
}

.upload-zone-wide {
  aspect-ratio: 9/16;
  height: 360px;
  width: auto;
}

.upload-zone-wide img,
.upload-zone-wide video {
  object-fit: cover;
}

/* Audio preview inside upload zone */
.audio-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  width: 100%;
  height: 100%;
}

.audio-filename {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #e8e4dc;
  text-align: center;
  word-break: break-all;
  max-width: 100%;
}

.audio-preview audio {
  width: 100%;
  max-width: 200px;
  height: 32px;
}

/* Kling motion: two uploads side by side as left column */
.motion-uploads {
  display: flex;
  gap: 15px;
}

.engine-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 768px) {
  .engine-layout {
    grid-template-columns: 1fr;
  }
  .engine-controls {
    grid-template-columns: 1fr;
  }
  .motion-uploads {
    flex-direction: column;
  }
}

.engine-controls .control-group {
  gap: 10px;
}

.kling-submode {
  display: none;
}

.kling-submode.active {
  display: block;
}

/* Kling Slot System */
#klingSlotsContainer {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.kling-slot {
  border: 1px solid #3a3a3a;
  padding: 20px;
}

.kling-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.kling-slot-remove {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid #3a3a3a;
  color: #a09a90;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
}

.kling-slot-remove:hover {
  color: #ff7a7a;
  border-color: #ff7a7a;
}

.kling-add-slot-btn {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1px dashed #3a3a3a;
  color: #a09a90;
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  margin-top: 15px;
}

.kling-add-slot-btn:hover {
  border-color: #e8e4dc;
  color: #e8e4dc;
}

/* Slot history */
.kling-slot-history {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid #2a2a2a;
}
.kling-history-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.kling-history-item {
  width: 70px;
  border: 1px solid #2a2a2a;
  cursor: pointer;
  transition: border-color 0.2s;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.kling-history-item:hover { border-color: #e8e4dc; }
.kling-history-item video {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  display: block;
}
.kling-history-actions {
  position: absolute;
  top: 3px;
  right: 3px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}
.kling-history-item:hover .kling-history-actions { opacity: 1; }
.kling-history-action-btn {
  width: 18px;
  height: 18px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(232,228,220,0.4);
  color: #e8e4dc;
  font-size: 0.55rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.kling-history-action-btn:hover { background: rgba(0,0,0,0.9); border-color: #e8e4dc; }
.kling-history-meta {
  padding: 0.15rem 0.25rem;
  font-family: Inter, sans-serif;
  font-size: 0.45rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: #5a5550;
  text-transform: uppercase;
}

/* Footer */
footer {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid #e8e4dc;
  text-align: center;
}

.footer-text {
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: #a09a90;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 80px;
}

.modal-content img {
  max-width: 100%;
  max-height: 90vh;
  min-height: 60vh;
  border: 1px solid #e8e4dc;
  object-fit: contain;
}

.modal-content video {
  max-width: 100%;
  max-height: 90vh;
  border: 1px solid #e8e4dc;
  object-fit: contain;
}

.modal-close {
  position: absolute;
  top: 30px;
  right: 40px;
  background: none;
  border: none;
  color: #e8e4dc;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #ffffff;
}

/* Fake Comment Tab */
.fc-lang-toggle {
  display: flex;
  gap: 0;
}

.fc-lang-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: 1px solid #e8e4dc;
  color: #a09a90;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.fc-lang-btn + .fc-lang-btn {
  border-left: none;
}

.fc-lang-btn:hover {
  color: #e8e4dc;
}

.fc-lang-btn.active {
  background: rgba(232, 228, 220, 0.1);
  color: #ffffff;
}

.fc-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1px;
  background: #3a3a3a;
  outline: none;
  cursor: pointer;
}

.fc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #000000;
  border: 1px solid #e8e4dc;
  cursor: pointer;
}

.fc-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #000000;
  border: 1px solid #e8e4dc;
  cursor: pointer;
  border-radius: 0;
}

.fc-preview-wrap {
  position: relative;
}

.fc-preview-wrap canvas {
  display: block;
  border: 1px solid #e8e4dc;
  cursor: grab;
  max-width: 100%;
  height: auto;
}

.fc-preview-wrap canvas:active {
  cursor: grabbing;
}

/* ─── Describe Tab ─────────────────────────────── */

.desc-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 860px) {
  .desc-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2.5rem;
    align-items: start;
  }
}

.desc-left-col {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.desc-right-col {
  min-height: 480px;
}

/* Upload zone */
.desc-upload-zone {
  border: 1px solid #e8e4dc;
  border-radius: 0;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background: #0a0a0a;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}
.desc-upload-zone:hover { border-color: #fff; background: #111; }
.desc-upload-zone img {
  width: 100%; height: 100%; max-height: 400px;
  object-fit: contain; padding: 0.25rem;
}

/* Input mode tabs (IMAGE | TEXT) */
.desc-input-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #e8e4dc;
  border-radius: 0;
  overflow: hidden;
}
.desc-input-mode-tab {
  padding: 0.6rem 0;
  border: none;
  border-right: 1px solid #e8e4dc;
  background: #000;
  color: #5a5550;
  font-size: 0.72rem;
  font-family: Inter, sans-serif;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.desc-input-mode-tab:last-child { border-right: none; }
.desc-input-mode-tab:hover { color: #fff; background: #111; }
.desc-input-mode-tab.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 400;
}

/* Mode selector (5-button bar) */
.desc-mode-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid #e8e4dc;
  border-radius: 0;
  overflow: hidden;
}
.desc-mode-btn {
  padding: 0.6rem 0;
  border: none;
  border-right: 1px solid #e8e4dc;
  background: #000;
  color: #5a5550;
  font-size: 0.6rem;
  font-family: Inter, sans-serif;
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.desc-mode-btn:last-child { border-right: none; }
.desc-mode-btn:hover { color: #fff; background: #111; }
.desc-mode-btn.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 400;
}

/* Paramedic sub-mode selector */
.desc-submode-selector {
  display: flex;
  border: 1px solid #e8e4dc;
  border-radius: 0;
  overflow: hidden;
}
.desc-submode-btn {
  flex: 1;
  padding: 0.4rem 0;
  border: none;
  border-right: 1px solid #e8e4dc;
  background: #000;
  color: #5a5550;
  font-family: Inter, sans-serif;
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.desc-submode-btn:last-child { border-right: none; }
.desc-submode-btn:hover:not(.disabled) { color: #fff; background: #111; }
.desc-submode-btn.active { background: rgba(255,255,255,0.08); color: #fff; font-weight: 400; }
.desc-submode-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.desc-soon { display: block; font-size: 0.45rem; letter-spacing: 0.06em; color: #5a5550; margin-top: 1px; }

/* Language selector */
.desc-lang-selector {
  display: flex;
  align-items: center;
  gap: 0;
}
.desc-lang-btn {
  padding: 0.35rem 0.4rem;
  border: none;
  background: transparent;
  color: #5a5550;
  font-size: 0.65rem;
  font-family: Inter, sans-serif;
  font-weight: 300;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
}
.desc-lang-btn:hover { color: #fff; }
.desc-lang-btn.active { color: #fff; font-weight: 600; }
.desc-pipe {
  color: #5a5550;
  font-size: 0.65rem;
  font-weight: 300;
  user-select: none;
}

/* Detail toggle */
.desc-detail-toggle {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.desc-detail-btn {
  padding: 0.35rem 0.4rem;
  border: none;
  background: transparent;
  color: #5a5550;
  font-size: 0.65rem;
  font-family: Inter, sans-serif;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.desc-detail-btn:hover { color: #fff; }
.desc-detail-btn.active { color: #fff; font-weight: 600; }

/* Controls row */
.desc-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

/* Custom instructions */
.desc-custom-instructions {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e8e4dc;
  border-radius: 0;
  background: #0a0a0a;
  color: #fff;
  font-family: Inter, sans-serif;
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  resize: vertical;
  min-height: 2.5rem;
  max-height: 6rem;
  outline: none;
  transition: border-color 0.2s;
}
.desc-custom-instructions::placeholder { color: #5a5550; }
.desc-custom-instructions:focus { border-color: #fff; }

/* Describe buttons */
.desc-btn-row { display: flex; gap: 0.5rem; }
.desc-btn-describe {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #e8e4dc;
  border-radius: 0;
  background: transparent;
  color: #e8e4dc;
  font-size: 0.8rem;
  font-family: Inter, sans-serif;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s;
}
.desc-btn-describe:hover:not(:disabled) { background: #fff; color: #000; }
.desc-btn-describe:disabled { opacity: 0.25; cursor: not-allowed; }

/* Reference image upload */
.desc-reference-upload { display: flex; align-items: center; gap: 0.75rem; }
.desc-reference-label {
  font-size: 0.68rem; font-weight: 300; text-transform: uppercase;
  letter-spacing: 0.1em; color: #5a5550; cursor: pointer;
  display: flex; align-items: center; gap: 0.5rem;
}
.desc-reference-input-hidden { width: 0; height: 0; opacity: 0; position: absolute; }
.desc-reference-label:hover { color: #fff; }
.desc-reference-thumb {
  width: 40px; height: 40px; border: 1px solid #e8e4dc;
  border-radius: 0; object-fit: cover;
}

/* Image history */
.desc-history {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0;
}
.desc-history-label {
  font-size: 0.45rem; font-weight: 300; text-transform: uppercase;
  letter-spacing: 0.08em; color: #444; white-space: nowrap;
}
.desc-history-strip {
  display: flex; gap: 0.2rem; overflow-x: auto; scrollbar-width: none;
}
.desc-history-strip::-webkit-scrollbar { display: none; }
.desc-history-thumb {
  width: 18px; height: 18px; border: 1px solid #333;
  border-radius: 0; padding: 0; background: #0a0a0a;
  cursor: pointer; overflow: hidden; flex-shrink: 0;
  transition: border-color 0.2s, opacity 0.2s;
  opacity: 0.6;
}
.desc-history-thumb.active { border-color: #fff; opacity: 1; }
.desc-history-thumb:hover { border-color: #e8e4dc; opacity: 1; }
.desc-history-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Output box (right column) */
.desc-output-box {
  background: #0a0a0a;
  border: 1px solid #e8e4dc;
  border-radius: 0;
  padding: 2rem 2.25rem;
  min-height: 480px;
  position: relative;
}
.desc-output-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; padding-bottom: 0.75rem;
  border-bottom: 1px solid #e8e4dc;
}
.desc-output-title {
  font-family: Inter, sans-serif; font-size: 0.68rem; font-weight: 300;
  text-transform: uppercase; letter-spacing: 0.16em; color: #e8e4dc; margin: 0;
}
.desc-output-actions { display: flex; gap: 0.35rem; }
.desc-action-btn {
  padding: 0.3rem 0.65rem; border: 1px solid #5a5550; border-radius: 0;
  background: transparent; color: #5a5550; font-family: Inter, sans-serif;
  font-size: 0.6rem; font-weight: 300; letter-spacing: 0.08em;
  text-transform: uppercase; cursor: pointer; transition: all 0.2s;
}
.desc-action-btn:hover { border-color: #e8e4dc; color: #fff; }
.desc-send-nano {
  border-color: #f5c542; color: #f5c542;
}
.desc-send-nano:hover {
  background: rgba(245, 197, 66, 0.12); border-color: #f5c542; color: #f5c542;
}

/* Character presets */
.desc-presets { display: flex; gap: 0.35rem; margin-bottom: 1rem; }
.desc-preset-btn {
  padding: 0.3rem 0.65rem; border: 1px solid #5a5550; border-radius: 0;
  background: transparent; color: #5a5550; font-family: Inter, sans-serif;
  font-size: 0.6rem; font-weight: 300; letter-spacing: 0.08em;
  text-transform: uppercase; cursor: pointer; transition: all 0.2s;
}
.desc-preset-btn:hover { border-color: #e8e4dc; color: #fff; }
.desc-preset-btn.active {
  border-color: #fff; background: rgba(255,255,255,0.08);
  color: #fff; font-weight: 400;
}

/* Clothing mode picker */
.desc-clothing-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
  cursor: default;
}
.desc-clothing-modal {
  background: #111; border: 1px solid #e8e4dc; padding: 2rem 2.5rem;
  max-width: 380px; width: 90%; text-align: center;
}
.desc-clothing-title {
  font-family: Inter, sans-serif; font-size: 0.75rem; font-weight: 400;
  letter-spacing: 0.1em; color: #e8e4dc; margin: 0 0 0.5rem;
}
.desc-clothing-subtitle {
  font-family: Inter, sans-serif; font-size: 0.65rem; font-weight: 300;
  color: #888; margin: 0 0 1.5rem;
}
.desc-clothing-btns { display: flex; gap: 1rem; }
.desc-clothing-btn {
  flex: 1; background: transparent; border: 1px solid #5a5550;
  padding: 1rem 0.75rem; cursor: pointer; transition: all 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.desc-clothing-btn:hover { border-color: #e8e4dc; cursor: pointer; }
.desc-clothing-btn-label {
  font-family: Inter, sans-serif; font-size: 0.75rem; font-weight: 400;
  letter-spacing: 0.1em; color: #e8e4dc;
}
.desc-clothing-btn-desc {
  font-family: Inter, sans-serif; font-size: 0.55rem; font-weight: 300;
  color: #888; line-height: 1.4;
}

/* Batch tabs */
.desc-batch-tabs {
  display: flex; margin-bottom: 1.25rem;
  border: 1px solid #e8e4dc; border-radius: 0; overflow: hidden;
}
.desc-batch-tab {
  flex: 1; padding: 0.45rem 0.3rem; border: none;
  border-right: 1px solid #e8e4dc; background: #111;
  color: #5a5550; font-family: Inter, sans-serif; font-size: 0.6rem;
  font-weight: 300; letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; transition: all 0.2s;
}
.desc-batch-tab:last-child { border-right: none; }
.desc-batch-tab:hover { color: #fff; }
.desc-batch-tab.active {
  background: rgba(255,255,255,0.08); color: #fff; font-weight: 400;
}

/* Description text */
.desc-text {
  font-family: Inter, sans-serif; font-size: 0.92rem; font-weight: 300;
  line-height: 1.9; color: #fff; white-space: pre-wrap;
}
.desc-text.streaming { color: #fff; }
.desc-placeholder {
  color: #5a5550; font-size: 0.85rem; font-weight: 300;
  line-height: 1.7; letter-spacing: 0.02em;
}
.desc-placeholder strong { color: #a09a90; font-weight: 400; }
.desc-error {
  color: #ff6b6b; font-size: 0.85rem; font-weight: 300; line-height: 1.6;
}

/* Cursor blink */
.desc-cursor-blink {
  display: inline-block; width: 2px; height: 1em;
  background: #e8e4dc; margin-left: 2px; vertical-align: text-bottom;
  animation: descBlink 0.8s step-end infinite;
}
@keyframes descBlink { 50% { opacity: 0; } }

/* Loading skeleton */
.desc-skeleton { display: flex; flex-direction: column; gap: 0.6rem; }
.desc-skeleton-line {
  height: 14px; border-radius: 3px;
  background: linear-gradient(90deg, #111 25%, #333 50%, #111 75%);
  background-size: 200% 100%;
  animation: descShimmer 1.5s ease-in-out infinite;
}
.desc-skeleton-line.w100 { width: 100%; }
.desc-skeleton-line.w95 { width: 95%; }
.desc-skeleton-line.w90 { width: 90%; }
.desc-skeleton-line.w85 { width: 85%; }
.desc-skeleton-line.w80 { width: 80%; }
.desc-skeleton-line.w70 { width: 70%; }
.desc-skeleton-line.w60 { width: 60%; }
@keyframes descShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Edit area */
.desc-edit-area {
  width: 100%; min-height: 300px; padding: 0.75rem;
  border: 1px solid #e8e4dc; border-radius: 0;
  background: #000; color: #fff; font-family: Inter, sans-serif;
  font-size: 0.92rem; font-weight: 300; line-height: 1.9;
  resize: vertical; outline: none;
}
.desc-edit-area:focus { border-color: #fff; }

/* Copy/Edit buttons */
.desc-copy-btn {
  padding: 0.3rem 0.7rem; border: 1px solid #e8e4dc; border-radius: 0;
  background: transparent; color: #5a5550; font-family: Inter, sans-serif;
  font-size: 0.65rem; font-weight: 300; letter-spacing: 0.08em;
  text-transform: uppercase; cursor: pointer; transition: all 0.2s;
}
.desc-copy-btn:hover { border-color: #fff; color: #fff; }

/* Text input (text mode) */
.desc-text-input {
  width: 100%; padding: 0.75rem 0.85rem;
  border: 1px solid #e8e4dc; border-radius: 0;
  background: #0a0a0a; color: #fff; font-family: Inter, sans-serif;
  font-size: 0.85rem; font-weight: 300; letter-spacing: 0.02em;
  line-height: 1.7; resize: vertical; min-height: 180px; max-height: 400px;
  outline: none; transition: border-color 0.2s;
}
.desc-text-input::placeholder { color: #5a5550; }
.desc-text-input:focus { border-color: #fff; }

/* Multi-image batch section */
.desc-multi-section {
  border-top: 1px solid #5a5550; padding-top: 1rem;
}
.desc-multi-header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.desc-multi-btn {
  padding: 0.4rem 0.7rem; border: 1px solid #e8e4dc; border-radius: 0;
  background: transparent; color: #5a5550; font-family: Inter, sans-serif;
  font-size: 0.65rem; font-weight: 300; letter-spacing: 0.08em;
  text-transform: uppercase; cursor: pointer; transition: all 0.2s;
}
.desc-multi-btn:hover:not(:disabled) { border-color: #fff; color: #fff; }
.desc-multi-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.desc-multi-clear {
  padding: 0.4rem 0.5rem; border: 1px solid #5a5550; border-radius: 0;
  background: transparent; color: #5a5550; font-family: Inter, sans-serif;
  font-size: 0.6rem; font-weight: 300; letter-spacing: 0.06em;
  text-transform: uppercase; cursor: pointer; transition: all 0.2s;
}
.desc-multi-clear:hover { border-color: #fff; color: #fff; }
.desc-multi-count {
  font-size: 0.65rem; font-weight: 300; color: #5a5550; letter-spacing: 0.04em;
}
.desc-multi-thumbs {
  display: flex; gap: 0.35rem; margin-top: 0.5rem;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 0.25rem;
}
.desc-multi-thumbs::-webkit-scrollbar { display: none; }
.desc-multi-thumb-wrap { position: relative; flex-shrink: 0; }
.desc-multi-thumb-img {
  width: 48px; height: 48px; border: 1px solid #5a5550;
  border-radius: 0; object-fit: cover;
}
.desc-multi-thumb-status {
  position: absolute; top: -4px; right: -4px;
  width: 14px; height: 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.5rem; font-weight: 600; color: #fff;
}
.desc-multi-thumb-status.ok { background: #7aff8c; }
.desc-multi-thumb-status.err { background: #ff6b6b; }

/* Multi-image results */
.desc-multi-result-card {
  background: #0a0a0a; border: 1px solid #e8e4dc;
  border-radius: 0; padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.desc-multi-result-header {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.75rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid #5a5550;
}
.desc-multi-result-thumb {
  width: 32px; height: 32px; border-radius: 0;
  object-fit: cover; border: 1px solid #5a5550;
}
.desc-multi-result-name {
  font-size: 0.7rem; font-weight: 300; color: #5a5550;
  letter-spacing: 0.04em; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.desc-multi-result-edit {
  width: 100%; background: #111; border: 1px solid #333;
  color: #e8e4dc; font-family: 'Inter', sans-serif;
  font-size: 0.75rem; padding: 8px; resize: vertical;
  line-height: 1.5; letter-spacing: 0.02em;
}
.desc-multi-result-edit:focus {
  border-color: #e8e4dc; outline: none;
}

/* Balance indicator for describe */
.desc-balance-dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block;
}
.desc-balance-dot.ok { background: #7aff8c; }
.desc-balance-dot.err { background: #ff6b6b; }
.desc-balance-dot.checking { background: #886; animation: descBlink 1s step-end infinite; }

/* ═══ Pipeline Tab ═══ */

.pipeline-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  min-height: calc(100vh - 120px);
}

.pipeline-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pl-user-btn {
  background: transparent;
  border: 1px solid #e8e4dc;
  color: #e8e4dc;
  padding: 4px 12px;
  font-size: 11px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.pl-user-btn:hover { background: rgba(255,255,255,0.1); }

.pl-user-picker {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}
.pl-user-picker .batch-btn {
  min-width: 80px;
}

.pipeline-meta-filters {
  display: flex;
  gap: 8px;
}

.pipeline-meta-filters select {
  background: #000;
  border: 1px solid #333;
  color: #e8e4dc;
  padding: 6px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

/* Kanban board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.kanban-col {
  display: flex;
  flex-direction: column;
  border: 1px solid #222;
  min-height: 0;
}

.kanban-col.drag-over {
  border-color: #e8e4dc;
  background: rgba(232, 228, 220, 0.03);
}

.kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #222;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #888;
  flex-shrink: 0;
}

.kanban-col[data-status="new"] .kanban-col-header { color: #4fc3f7; }
.kanban-col[data-status="selected"] .kanban-col-header { color: #fff176; }
.kanban-col[data-status="ready"] .kanban-col-header { color: #81c784; }
.kanban-col[data-status="posted"] .kanban-col-header { color: #666; }

.kanban-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.kanban-action-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: inherit;
  font-size: 0.7rem;
  padding: 2px 6px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s, border-color 0.2s;
}
.kanban-action-btn:hover { opacity: 1; border-color: currentColor; }

.kanban-count {
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  font-size: 0.6rem;
  color: inherit;
}

.kanban-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  align-content: start;
}

.pl-card {
  position: relative;
  border: 1px solid #222;
  cursor: grab;
  transition: border-color 0.2s, opacity 0.2s;
  overflow: hidden;
}

.pl-card:hover { border-color: #e8e4dc; }
.pl-card.dragging { opacity: 0.4; }

.pl-card img,
.pl-card video {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  display: block;
}

.pl-video-static {
  background: #111;
  pointer-events: none;
}

.pl-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pl-card-tags {
  font-size: 0.55rem;
  color: #aaa;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pl-card-kling {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 2;
  font-family: 'Inter', sans-serif;
}

.pl-card:hover .pl-card-kling { opacity: 1; }
.pl-card-kling:hover { background: rgba(232, 228, 220, 0.3); border-color: #e8e4dc; }

/* Pipeline save modal */
.pl-save-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.pl-save-modal {
  background: #111;
  border: 1px solid #e8e4dc;
  padding: 24px;
  max-width: 360px;
  width: 90%;
}

.pl-save-modal h3 {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: #e8e4dc;
}

.pl-save-modal label {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 4px;
  margin-top: 12px;
}

.pl-save-modal select,
.pl-save-modal textarea {
  width: 100%;
  background: #000;
  border: 1px solid #333;
  color: #e8e4dc;
  padding: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
}

.pl-save-modal textarea {
  height: 60px;
  resize: vertical;
}

.pl-save-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.pl-save-modal-actions button {
  flex: 1;
  padding: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid #333;
  background: transparent;
  color: #888;
  transition: all 0.2s;
}

.pl-save-modal-actions button:hover { border-color: #e8e4dc; color: #e8e4dc; }
.pl-save-modal-actions button.primary { background: #e8e4dc; color: #000; border-color: #e8e4dc; }
.pl-save-modal-actions button.primary:hover { background: #fff; }

/* Pipeline detail panel */
.pl-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.pl-detail {
  background: #111;
  border: 1px solid #e8e4dc;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.pl-detail-media-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.pl-detail-media {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

.pl-detail-info {
  width: 180px;
  flex-shrink: 0;
  padding: 16px;
  border-left: 1px solid #222;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.pl-detail-info label {
  display: block;
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 3px;
  margin-top: 10px;
}

.pl-detail-info label:first-child { margin-top: 0; }

.pl-detail-info select,
.pl-detail-info textarea {
  width: 100%;
  background: #000;
  border: 1px solid #333;
  color: #e8e4dc;
  padding: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
}

.pl-detail-info textarea {
  height: 60px;
  resize: vertical;
}

.pl-detail-status-row {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.pl-detail-status-btn {
  background: transparent;
  border: 1px solid #333;
  color: #666;
  padding: 4px 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.pl-detail-status-btn:hover { border-color: #e8e4dc; color: #e8e4dc; }
.pl-detail-status-btn.active { background: rgba(255,255,255,0.1); border-color: #e8e4dc; color: #e8e4dc; }

.pl-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #222;
}

.pl-detail-actions button {
  width: 100%;
  padding: 7px 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid #333;
  background: transparent;
  color: #888;
  transition: all 0.2s;
}

.pl-detail-actions button:hover { border-color: #e8e4dc; color: #e8e4dc; }
.pl-detail-actions button.danger:hover { border-color: #e57373; color: #e57373; }

/* Save-to-pipeline button on result cards */
.pipeline-save-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 2;
  line-height: 1;
}

.result-item:hover .pipeline-save-btn { opacity: 1; }
.pipeline-save-btn:hover { background: rgba(232, 228, 220, 0.3); border-color: #e8e4dc; }
.pipeline-save-btn.saved { opacity: 1; color: #81c784; border-color: #81c784; pointer-events: none; }

.regen-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 2;
  line-height: 1;
}
.result-item:hover .regen-btn { opacity: 1; }
.regen-btn:hover { background: rgba(232, 228, 220, 0.3); border-color: #e8e4dc; }
.regen-btn.spinning { opacity: 1; animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Empty state */
.pl-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: #444;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  header h1 {
    font-size: 1rem;
    letter-spacing: 0.25em;
  }

  .layout {
    gap: 30px;
  }

  .targets-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-content {
    padding: 0 20px;
  }

  .modal-close {
    top: 15px;
    right: 15px;
  }

  .tab-btn {
    font-size: 0.55rem;
    padding: 10px 12px;
    letter-spacing: 0.1em;
  }
}

/* ─── Hot Reels ─────────────────────────────────────────────────────────────── */

.hot-reels-section {
  margin-bottom: 20px;
  border: 1px solid #e8e4dc;
  padding: 12px;
}

.hot-reels-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  cursor: pointer;
  user-select: none;
}

.hot-reels-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #e8e4dc;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hr-arrow {
  font-size: 8px;
  transition: transform 0.2s;
}

.hr-badge {
  background: rgba(245,197,66,0.2);
  color: #f5c542;
  font-size: 9px;
  padding: 1px 6px;
  margin-left: 4px;
}

.hot-reels-fire-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  transition: transform 0.15s, opacity 0.15s;
  opacity: 0.7;
  display: flex;
  align-items: center;
}

.hot-reels-fire-btn:hover {
  transform: scale(1.15);
  opacity: 1;
}

.hr-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hr-period-btns {
  display: flex;
  gap: 2px;
}

.hr-period-btn {
  background: transparent;
  border: 1px solid #333;
  color: #666;
  font-family: inherit;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.hr-period-btn:hover {
  color: #e8e4dc;
  border-color: #555;
}

.hr-period-btn.active {
  color: #f5c542;
  border-color: #f5c542;
  background: rgba(245,197,66,0.08);
}

.hot-reels-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
}

.hot-reels-scroll::-webkit-scrollbar {
  height: 6px;
}

.hot-reels-scroll::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

.hot-reel-card {
  flex: 0 0 160px;
  position: relative;
  border: 1px solid #333;
  cursor: pointer;
  transition: border-color 0.2s;
}

.hot-reel-card:hover {
  border-color: #e8e4dc;
}

.hot-reel-card img {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  display: block;
}

.hot-reel-card .hr-views {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  letter-spacing: 0.5px;
}

.hot-reel-card .hr-handle {
  position: absolute;
  bottom: 36px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 9px;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.hot-reel-card .hr-age {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  color: #999;
  background: rgba(0,0,0,0.6);
  padding: 1px 5px;
}

.hot-reel-replicate {
  display: block;
  width: 100%;
  padding: 6px 0;
  border: none;
  border-top: 1px solid #333;
  background: transparent;
  color: #f5c542;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.hot-reel-replicate:hover {
  background: rgba(245,197,66,0.1);
}

.hot-reel-replicate:disabled {
  color: #666;
  cursor: not-allowed;
}

.hot-reels-empty {
  color: #666;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 20px 0;
  text-align: center;
  width: 100%;
}

/* Replicate From Others */
.ro-drop-zone {
  border: 1px dashed #444;
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  margin-bottom: 10px;
}

.ro-drop-zone:hover,
.ro-drop-zone.drag-over {
  border-color: #e8e4dc;
  color: #e8e4dc;
}

.ro-drop-zone input[type="file"] {
  display: none;
}

.ro-card {
  display: flex;
  flex-direction: column;
}

.ro-card img {
  flex: 1;
  min-height: 0;
}

.ro-card-footer {
  display: flex;
  flex-direction: column;
}

.ro-filename {
  display: block;
  text-align: center;
  font-size: 8px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 4px 2px;
  background: #000;
  border-top: 1px solid #333;
}

.ro-preset-select {
  display: block;
  width: 100%;
  padding: 5px 0;
  border: none;
  border-top: 1px solid #333;
  background: #111;
  color: #e8e4dc;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

.ro-card .hot-reel-replicate {
  position: relative;
}

.ro-thumb-wrap {
  position: relative;
  cursor: pointer;
}

.ro-thumb-wrap img {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  display: block;
}

.ro-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  color: rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.5);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.ro-thumb-wrap:hover .ro-play-btn {
  opacity: 1;
}

.ro-video-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
}

.ro-video-modal video {
  max-height: 85vh;
  max-width: 90vw;
  border: 1px solid #333;
  cursor: default;
}


/* ─── Face Refs Config ────────────────────────────────────────────── */
.face-refs-gear {
  float: right;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s;
  font-size: 14px;
}
.face-refs-gear:hover {
  opacity: 1;
}
.face-refs-select {
  width: 100%;
  padding: 8px 6px;
  background: #111;
  border: 1px solid #e8e4dc;
  color: #e8e4dc;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  margin-bottom: 14px;
}
.face-refs-config {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preset-config-card {
  border: 1px solid #333;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.preset-config-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.preset-config-label {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid #444;
  color: #e8e4dc;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 0;
}
.preset-config-id {
  font-size: 8px;
  color: #666;
  letter-spacing: 0.05em;
}
.preset-config-delete {
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
}
.preset-config-delete:hover {
  color: #f55;
}
.preset-config-refs {
  display: flex;
  gap: 8px;
}
.preset-config-ref {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.preset-config-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 1px solid #444;
  cursor: pointer;
}
.preset-config-thumb-empty {
  width: 60px;
  height: 60px;
  border: 1px dashed #444;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font-size: 16px;
}
.preset-config-upload-btn {
  font-size: 8px;
  font-weight: 600;
  color: #e8e4dc;
  letter-spacing: 0.1em;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.preset-config-upload-btn:hover {
  opacity: 1;
}
.preset-config-suffix {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  color: #e8e4dc;
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  padding: 6px;
  resize: vertical;
  letter-spacing: 0.02em;
  line-height: 1.4;
}
.preset-config-suffix::placeholder {
  color: #555;
}

/* ─── Replicate Queue ─────────────────────────────────────────────── */
.pipeline-section {
  border: 1px solid #e8e4dc;
  margin-bottom: 8px;
}
.pipeline-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #e8e4dc;
  user-select: none;
}
.pipeline-section-header:hover {
  background: rgba(255,255,255,0.05);
}
.pipeline-section-header .badge {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid #e8e4dc;
  font-size: 10px;
  margin-left: 6px;
}
.pipeline-section-header .toggle-arrow {
  font-size: 10px;
  opacity: 0.6;
}
.pipeline-section-body {
  padding: 12px;
  border-top: 1px solid rgba(232,228,220,0.3);
}
.replicate-queue-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.replicate-url-input-wrap {
  display: flex;
  gap: 4px;
}
.replicate-url-input {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid #e8e4dc;
  color: #e8e4dc;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.replicate-url-input::placeholder {
  color: rgba(232,228,220,0.4);
}
.replicate-drop-zone {
  min-height: 60px;
  height: auto;
  aspect-ratio: unset;
}
.rq-card {
  display: flex;
  flex-direction: column;
}
.rq-card .ro-thumb-wrap video {
  pointer-events: none;
}
.rq-username {
  display: block;
  text-align: center;
  font-size: 8px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 4px 2px;
  background: #000;
  border-top: 1px solid #333;
}
.rq-niche {
  display: block;
  text-align: center;
  font-size: 8px;
  color: rgba(232,228,220,0.5);
  letter-spacing: 0.5px;
  padding: 0 4px 4px;
  background: #000;
}

/* ─── History Tab ────────────────────────────────────────────────────────── */
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 20px 30px 0;
}

.history-clear-btn {
  background: transparent;
  border: none;
  color: #4a4540;
  font-family: inherit;
  font-size: 0.5rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}

.history-clear-btn:hover {
  color: #e8e4dc;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 30px 30px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.history-entry {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #222;
  cursor: pointer;
  transition: border-color 0.2s;
}

.history-entry:hover {
  border-color: #e8e4dc;
}

.history-thumb {
  width: 80px;
  height: 140px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #333;
  cursor: pointer;
  transition: border-color 0.2s;
}

.history-thumb:hover {
  border-color: #e8e4dc;
}

.history-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.history-dl-btn {
  padding: 5px 10px;
  background: transparent;
  border: 1px solid #555;
  color: #999;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.history-dl-btn:hover {
  border-color: #e8e4dc;
  color: #e8e4dc;
}

.history-info {
  flex: 1;
  min-width: 0;
}

.history-prompt {
  color: #e8e4dc;
  font-size: 0.7rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-meta {
  color: #6a6560;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  margin-top: 4px;
  transition: color 0.2s;
}

.history-use-btn {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid #e8e4dc;
  color: #e8e4dc;
  font-family: inherit;
  font-size: 0.5rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.history-use-btn:hover {
  background: rgba(232, 228, 220, 0.1);
}

.history-full-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 8px;
  border: 1px solid #c9a040;
  color: #c9a040;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
}

.history-clean-btn {
  padding: 4px 12px;
  background: transparent;
  border: 1px solid #c9a040;
  color: #c9a040;
  font-family: inherit;
  font-size: 0.5rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: background 0.2s;
}

.history-clean-btn:hover {
  background: rgba(201, 160, 64, 0.15);
}

.tab-btn.history-full-pulse {
  color: #c9a040;
  animation: history-pulse 0.5s ease 3;
}

@keyframes history-pulse {
  0%, 100% { color: #c9a040; }
  50% { color: #fff; }
}
