.unauth-generate-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.unauth-generate-modal.active {
  opacity: 1;
  visibility: visible;
}

.unauth-generate-modal-content {
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.98) 0%, rgba(42, 42, 42, 0.98) 100%);
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.18), 0 0 60px rgba(255, 215, 0, 0.08);
  max-width: 460px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(30px) scale(0.95);
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 215, 0, 0.3);
}

.unauth-generate-modal.active .unauth-generate-modal-content {
  transform: translateY(0) scale(1);
}

.unauth-generate-modal-header {
  display: flex;
  justify-content: flex-end;
  padding: 20px 20px 0 20px;
}

.unauth-generate-modal-close {
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: #FFD700;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.25);
}

.unauth-generate-modal-close:hover {
  background: rgba(255, 215, 0, 0.2);
  color: #1a1a1a;
  transform: scale(1.1);
}

.unauth-generate-modal-body {
  padding: 0 30px 30px 30px;
  text-align: center;
}

.unauth-generate-modal-icon {
  margin: 0 auto 20px auto;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1a1a;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.unauth-generate-modal-title {
  color: #FFD700;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.unauth-generate-modal-message {
  color: #e5e7eb;
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 30px 0;
  opacity: 0.9;
}

.unauth-generate-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.unauth-generate-modal-btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}

.unauth-generate-modal-login {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #1a1a1a;
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.35);
}

.unauth-generate-modal-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 215, 0, 0.5);
  color: #1a1a1a;
}

.unauth-generate-modal-signup {
  background: transparent;
  color: #FFD700;
  border-color: rgba(255, 215, 0, 0.35);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.15);
}

.unauth-generate-modal-signup:hover {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.25);
  color: #FFD700;
}
 /* Edits-specific styles */
/* Credit Balance Pill (copied from recreate, namespaced) */
.credit-balance-pill {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, #facc15 0%, #fbbf24 100%);
    color: #1f2937;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Generation modal minimal (compatible with recreate)
   Only the essentials for edits page */
.generation-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.generation-modal.active {
  opacity: 1;
  visibility: visible;
}

.generation-modal-content {
  text-align: center;
  transform: scale(0.8) rotate(-5deg);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 90vw;
  padding: 2rem;
}

.generation-modal.active .generation-modal-content {
  transform: scale(1) rotate(0deg);
}

.generation-loader {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
}

.loader-ring {
  position: absolute;
  border: 3px solid transparent;
  border-radius: 50%;
  animation: spin 2s linear infinite;
}

.loader-ring:nth-child(1) {
  width: 120px;
  height: 120px;
  border-top: 3px solid #FFD700;
  border-right: 3px solid #FFD700;
  animation-duration: 2s;
}

.loader-ring:nth-child(2) {
  width: 90px;
  height: 90px;
  top: 15px;
  left: 15px;
  border-bottom: 3px solid #FFA500;
  border-left: 3px solid #FFA500;
  animation-duration: 1.5s;
  animation-direction: reverse;
}

.loader-ring:nth-child(3) {
  width: 60px;
  height: 60px;
  top: 30px;
  left: 30px;
  border-top: 3px solid #FFD700;
  border-right: 3px solid #FFD700;
  animation-duration: 1s;
}

/* removed duplicate .loader-center (see enhanced version below) */

/* removed duplicate .generation-message (see enhanced version below) */

.generation-progress-container {
  width: 100%;
  max-width: 300px;
  margin: 1.5rem auto;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 20px;
  padding: 4px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
  position: relative;
  overflow: hidden;
}

.generation-progress-bar {
  height: 8px;
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 25%, #15803d 50%, #166534 75%, #14532d 100%);
  border-radius: 16px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6), 0 0 20px rgba(34, 197, 94, 0.4), 0 0 30px rgba(34, 197, 94, 0.2);
}

.generation-progress-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  border-radius: 16px;
  animation: progressGlow 2s ease-in-out infinite;
}

.generation-progress-bar.submitted { width: 25%; }
.generation-progress-bar.pending { width: 50%; }
.generation-progress-bar.processing { width: 75%; }
.generation-progress-bar.completed { width: 100%; }

.generation-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: #22c55e;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Progress text visibility (parity with recreate) */
.generation-progress-text.show {
  opacity: 1;
}

.generation-progress-stage {
  position: absolute;
  top: -25px;
  font-size: 0.7rem;
  color: #22c55e;
  font-weight: 500;
  opacity: 0.7;
  transition: all 0.3s ease;
}

/* Stage state styles (parity with recreate) */
.generation-progress-stage.active {
  opacity: 1;
  color: #22c55e;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  font-weight: 600;
}

.generation-progress-stage.completed {
  opacity: 1;
  color: #16a34a;
}

/* Stage positions */
.generation-progress-stage.submitted { left: 0%; }
.generation-progress-stage.pending { left: 25%; }
.generation-progress-stage.processing { left: 50%; }
.generation-progress-stage.completed { left: 75%; }

@keyframes progressGlow {
  0%, 100% { opacity: 0.3; transform: translateX(-100%); }
  50% { opacity: 0.6; transform: translateX(100%); }
}

/* Match recreate: generation modal extended visuals */
.generation-modal-content {
  max-width: 90vw;
}

.generation-modal.active .generation-modal-content {
  transform: scale(1) rotate(0deg);
}

.loader-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 1.5s ease-in-out infinite alternate;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

.loader-icon {
  width: 20px;
  height: 20px;
  color: #1a1a1a;
  animation: iconBounce 2s ease-in-out infinite;
}

.loader-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #FFD700;
  border-radius: 50%;
  animation: float 3s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.loader-particle:nth-child(4) { top: 10px; left: 50%; animation-delay: 0s; }
.loader-particle:nth-child(5) { top: 50%; right: 10px; animation-delay: 0.5s; }
.loader-particle:nth-child(6) { bottom: 10px; left: 50%; animation-delay: 1s; }
.loader-particle:nth-child(7) { top: 50%; left: 10px; animation-delay: 1.5s; }

.generation-message {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 2s ease-in-out infinite;
}

.generation-subtitle {
  color: #ccc;
  font-size: 1.1rem;
  font-weight: 400;
  opacity: 0.9;
  animation: fadeInOut 2s ease-in-out infinite;
}

.queue-details {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 215, 0, 0.08);
  border-radius: 1rem;
  border: 1px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

.queue-apology {
  color: #fbbf24;
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.9;
  margin-top: 0.75rem;
  font-style: italic;
  text-align: center;
}

.queue-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  text-align: center;
}

.queue-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
}

.queue-label {
  font-size: 0.8rem;
  color: #ccc;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.queue-value {
  font-size: 1rem;
  color: #FFD700;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.loading-dots { display: inline-block; margin-left: 0.5rem; }
.loading-dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FFD700;
  margin: 0 2px;
  animation: dotPulse 1.4s ease-in-out infinite both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

/* Validation overlay */
.validation-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.validation-loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.validation-loading-content {
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(42, 42, 42, 0.95) 100%);
  border: 2px solid rgba(255, 215, 0, 0.35);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.18), 0 0 60px rgba(255, 215, 0, 0.08);
  transform: scale(0.8);
  transition: transform 0.3s ease;
  max-width: 320px;
  width: 90%;
}

.validation-loading-overlay.active .validation-loading-content {
  transform: scale(1);
}

.validation-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.validation-spinner {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: validationSpin 2s linear infinite;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.45), 0 0 50px rgba(255, 215, 0, 0.25);
}

.validation-spinner svg {
  width: 20px;
  height: 20px;
  color: #1f2937;
  animation: validationPulse 1.5s ease-in-out infinite;
}

.validation-message {
  font-size: 18px;
  font-weight: 600;
  color: #FFD700;
  margin: 0;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.validation-submessage {
  font-size: 14px;
  color: #e5e7eb;
  margin: 0;
  opacity: 0.9;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes validationSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
  }
  100% {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.8);
  }
}

@keyframes iconBounce { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-5px);} }
@keyframes float { 0%,100% { transform: translateY(0) scale(1); opacity:1;} 50% { transform: translateY(-20px) scale(1.2); opacity:.7;} }
@keyframes shimmer { 0% { background-position: -200% 0;} 100% { background-position: 200% 0;} }
@keyframes fadeInOut { 0%,100% { opacity:.9;} 50% { opacity:.6;} }
@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* Plan upgrade modal overrides to match recreate */
#planUpgradeModal.unauth-generate-modal { background: rgba(0,0,0,0.85); }
#planUpgradeModal .unauth-generate-modal-content {
  background: linear-gradient(135deg, rgba(26,26,26,0.98) 0%, rgba(42,42,42,0.98) 100%);
  border: 2px solid rgba(255,215,0,0.4);
  box-shadow: 0 0 30px rgba(255,215,0,0.22), 0 0 60px rgba(255,215,0,0.12);
}
#planUpgradeModal .unauth-generate-modal-title { color: #FFD700; }
#planUpgradeModal .unauth-generate-modal-message { color: #e5e7eb; }
#planUpgradeModal .unauth-generate-modal-login,
#planUpgradeModal .unauth-generate-modal-signup {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #1a1a1a;
  border-color: rgba(255,215,0,0.35);
}

/* Mobile responsive styles for unauth modal (grouped at bottom) */

/* Mobile responsive styles for unauth modal (grouped at bottom) */

/* Fixed footer positioning for edits mode */
.edits-mode .input-bar {
    position: fixed;
    bottom: 0;
    left: 260px; /* Updated to match new sidebar width */
    right: 0;
    z-index: 50;
    margin: 0;
    padding: 0.75rem 1.5rem; /* Reduced from 1.75rem 2rem */
}

/* Desktop layout for edits footer (match recreate proportions) */
.edits-mode .input-container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 0rem 1.5rem;
  align-items: start;
  grid-template-areas:
    "mode mode mode"
    "upload textarea generate";
}

.edits-mode .mode-dropdown-section { grid-area: mode; justify-self: center; }
.edits-mode .file-upload-section { grid-area: upload; }
.edits-mode .text-input-section { grid-area: textarea; }
.edits-mode .generate-section { grid-area: generate; }

/* Adjust chat area to account for fixed footer */
.edits-mode .chat-area {
    padding-bottom: 250px; /* Reduced from 200px */
    height: calc(100vh - 250px);
    overflow-y: auto;
}

/* Enhanced file upload styling for edits mode (match recreate) */
.edits-mode .file-upload-btn,
.edits-mode .upload-link-btn,
.edits-mode .generate-btn {
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 1rem;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    min-height: 50px; /* Compact height for desktop */
    min-width: 120px;
    padding: 0.6rem 1rem; /* Tighter padding */
    display: flex;
    flex-direction: row; /* Horizontal layout for compact design */
    align-items: center;
    justify-content: center;
    gap: 0.4rem; /* Smaller gap */
    font-size: 0.85rem; /* Smaller font */
    color: #FFD700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

/* hover consolidated below with upload-link button */

/* Enhanced textarea styling for edits mode */
.edits-mode .message-textarea {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.9) 0%, rgba(42, 42, 42, 0.9) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
    min-height: 90px; /* Match recreate */
    padding: 1rem;
}

.edits-mode .message-textarea:focus {
    border-color: #FFD700;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
}

/* Enhanced generate button for edits mode */
.edits-mode .generate-btn { 
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    animation: recreateButtonGlow 2s ease-in-out infinite alternate; /* match recreate */
    color: #1a1a1a;
    font-weight: 800;
    display: inline-flex;
    flex-direction: column; /* second line under main row */
    align-items: center;
}
.edits-mode .generate-btn .generate-top {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1.1;
}
.edits-mode .generate-btn .credits-inline {
    display: block;
    margin-top: 1px;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    color: #1a1a1a;
    opacity: 0.95;
}

/* generate-btn hover kept once (duplicate removed later) */

/* Special welcome message styling for edits mode */
.edits-mode .welcome-message .message-text {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 215, 0, 0.06) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.25);
}

/* Welcome text styling to match recreate */
.edits-mode .welcome-main-text {
  font-size: 1.1rem;
  line-height: 1.6;
  font-weight: 600;
  color: #ffec7e;
  margin-bottom: 0.3rem;
  margin-top: 0.3rem;
}

.edits-mode .welcome-sub-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #ededca;
  margin-left: 1rem;
  margin-bottom: 0.3rem;
}

/* Edits-specific animations */
@keyframes editsButtonGlow {
    0% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    }
    100% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
    }
}

/* Progress indicator for file upload */
.upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 0 0 1rem 1rem;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* File preview styling */
.file-preview {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Mode dropdown styling for edits mode */
.mode-dropdown-section {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.mode-dropdown {
    position: relative;
    display: inline-block;
}

.mode-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
    border: 2px solid #FFD700;
    border-radius: 0.75rem;
    color: #FFD700;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    animation: modeGlow 2s ease-in-out infinite alternate;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-dropdown-btn:hover {
    border-color: #FFD700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.15) 100%);
}

.mode-dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(42, 42, 42, 0.95) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 1rem;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    margin-bottom: 0.5rem;
    backdrop-filter: blur(10px);
    display: none;
    z-index: 100;
    min-width: 150px;
}

.mode-dropdown-menu.show {
    display: block;
    animation: dropdownSlideUp 0.3s ease-out;
}

.mode-option {
    padding: 1rem 1.5rem;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    font-weight: 500;
}

.mode-option:last-child {
    border-bottom: none;
    border-radius: 0 0 1rem 1rem;
}

.mode-option:first-child {
    border-radius: 1rem 1rem 0 0;
}

.mode-option:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    color: #FFD700;
}

.mode-option.selected {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
    color: #FFD700;
    font-weight: 600;
    border-left: 4px solid #FFD700;
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.2);
}

@keyframes modeGlow {
    0% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    }
    100% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    }
}

@keyframes dropdownSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-preview img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 0.5rem;
    object-fit: cover;
}

/* Download modal (parity with recreate) */
.download-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.download-modal.active {
  opacity: 1;
  visibility: visible;
}

.download-modal-content {
  text-align: center;
  transform: scale(0.7) translateY(30px);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 90vw;
  padding: 2rem;
}

.download-modal.active .download-modal-content {
  transform: scale(1) translateY(0);
}

.download-loader {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 2rem;
}

.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid #10b981;
  border-radius: 50%;
  animation: pulseRing 2s ease-out infinite;
}

.pulse-ring:nth-child(1) { animation-delay: 0s; }
.pulse-ring:nth-child(2) { animation-delay: 0.4s; }
.pulse-ring:nth-child(3) { animation-delay: 0.8s; }

.download-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  animation: downloadIconBounce 1.5s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.download-icon svg {
  width: 18px;
  height: 18px;
}

.download-message {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  background: linear-gradient(135deg, #10b981 0%, #34d399 50%, #10b981 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: downloadShimmer 2.5s ease-in-out infinite;
}

.download-subtitle {
  color: #d1d5db;
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.9;
  animation: downloadFadeInOut 2s ease-in-out infinite;
}

.download-dots {
  display: inline-block;
  margin-left: 0.5rem;
}
.download-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  margin: 0 2px;
  animation: downloadDotPulse 1.2s ease-in-out infinite both;
}
.download-dots span:nth-child(1) { animation-delay: -0.24s; }
.download-dots span:nth-child(2) { animation-delay: -0.12s; }
.download-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes pulseRing {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

@keyframes downloadIconBounce {
  0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 20px rgba(16, 185, 129, 0.4); }
  50% { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 30px rgba(16, 185, 129, 0.6); }
}

@keyframes downloadShimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes downloadFadeInOut { 0%, 100% { opacity: 0.9; } 50% { opacity: 0.6; } }
@keyframes downloadDotPulse {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.3); opacity: 1; }
}

/* Chat image message styling */
.uploaded-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 215, 0, 0.03) 100%);
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 1rem;
    margin: 0.5rem 0;
}

/* Generated image responsive sizing (parity with text mode) */
.generated-result { width: 100%; }
.generated-image-container { max-width: 100%; }
.generated-result .generated-image { display: block; margin: 0 auto; }

/* Landscape 16:9 */
.generated-result.aspect-16-9 .generated-image {
  width: 100%;
  height: auto;
}

/* Portrait 9:16 (tall) */
.generated-result.aspect-9-16 .generated-image {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
}

/* Square 1:1 */
.generated-result.aspect-1-1 .generated-image {
  width: 70%;
  height: auto;
}

/* Portrait 4:5 */
.generated-result.aspect-4-5 .generated-image {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

/* Small screens: relax caps */
@media (max-width: 640px) {
  .generated-result.aspect-16-9 .generated-image { max-width: 100%; }
  .generated-result.aspect-1-1 .generated-image { max-width: 92vw; }
  .generated-result.aspect-9-16 .generated-image { max-height: 65vh; }
  .generated-result.aspect-4-5 .generated-image { max-height: 75vh; }
}

.uploaded-image {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 0.75rem;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* User Request Card (match recreate theme) */
.user-message .user-request-card {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.9) 0%, rgba(42, 42, 42, 0.9) 100%);
    border: 1.5px solid rgba(255, 215, 0, 0.35);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    box-shadow: 0 6px 24px rgba(255, 215, 0, 0.12), inset 0 0 0 1px rgba(255, 215, 0, 0.12);
}

.user-request-card .request-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.user-request-card .request-title {
    color: #ffec7e;
    font-weight: 800;
    letter-spacing: 0.2px;
    text-align: center;
}

.user-request-card .request-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
}

.user-request-card .badge {
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-gold { /* not used in edits, kept for parity */
    color: #1a1a1a;
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.badge-slate { /* not used in edits, kept for parity */
    color: #e5e7eb;
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.25);
}

.badge-cost {
    color: #1a1a1a;
    background: linear-gradient(135deg, #fde68a, #fbbf24);
}

.user-request-card .request-body .row {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 0.6rem;
    align-items: center;
    padding: 0.35rem 0;
    border-top: 1px dashed rgba(255, 215, 0, 0.18);
}

.user-request-card .request-body .row:first-child {
    border-top: 0;
}

.user-request-card .label {
    color: #fcd34d;
    font-size: 0.9rem;
    font-weight: 600;
}

.user-request-card .value {
    color: #f3f4f6;
}

.user-request-card .desc {
    background: rgba(255, 215, 0, 0.06);
    border: 1px solid rgba(255, 215, 0, 0.18);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    line-height: 1.45;
    color: #ededca;
    display: flex;
    align-items: center;
    min-height: 38px;
    font-size: 0.9rem;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* NEW: Image selection styles */
.image-wrapper {
    position: relative;
    display: inline-block;
}

.edits-mode .file-upload-btn,
.edits-mode .upload-link-btn {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
}

.edits-mode .upload-link-btn:hover,
.edits-mode .file-upload-btn:hover {
    border-color: #FFD700;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
}

/* duplicate generate-btn:hover removed; see earlier definition */

/* Upload from Link modal (mirrors recreate styles) */
.upload-link-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-link-modal.active {
  opacity: 1;
  visibility: visible;
}

.upload-link-modal-content {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 20px;
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(59, 130, 246, 0.3),
              0 0 20px rgba(59, 130, 246, 0.2);
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.upload-link-modal.active .upload-link-modal-content {
  transform: scale(1) translateY(0);
}

.upload-link-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.upload-link-modal-title {
  color: #f1f5f9;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.upload-link-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.upload-link-close-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.upload-link-input-group {
  margin-bottom: 1.5rem;
}

.upload-link-input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #334155;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  color: #f1f5f9;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.upload-link-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.upload-link-input::placeholder {
  color: #64748b;
}

.upload-link-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.upload-link-fetch-btn {
  flex: 1;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.upload-link-fetch-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.upload-link-fetch-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.upload-link-cancel-btn {
  padding: 0.875rem 1.5rem;
  background: rgba(71, 85, 105, 0.5);
  border: 2px solid #475569;
  border-radius: 12px;
  color: #cbd5e1;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-link-cancel-btn:hover {
  background: rgba(71, 85, 105, 0.8);
  border-color: #64748b;
}

.upload-link-loading {
  display: none;
  text-align: center;
  color: #94a3b8;
  margin: 1rem 0;
}

.upload-link-loading.show {
  display: block;
}

.upload-link-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #334155;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

.upload-link-preview {
  display: none;
  text-align: center;
  margin-bottom: 1.5rem;
}

.upload-link-preview.show {
  display: block;
}

.upload-link-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 1rem;
}

.upload-link-use-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.upload-link-use-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

/* Upload from Link modal error styles (parity with recreate) */
.upload-link-error {
  display: none;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 1rem;
  color: #fca5a5;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.upload-link-error.show {
  display: block;
}

/* Stack the two buttons vertically and size them to match textarea height */
.edits-mode .file-upload-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem; /* match recreate gap between stacked buttons */
}

/* Edits responsive (grouped at bottom) */

/* Recreate parity animation */
@keyframes recreateButtonGlow {
    0% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.3); }
    100% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.4); }
}

.selection-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: all;
    z-index: 10;
}

.image-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.selection-btn,
.save-selection-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 0.5rem;
    color: #FFD700;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 40px;
}

.selection-btn:hover,
.save-selection-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    transform: translateY(-1px);
}

.selection-btn:active,
.save-selection-btn:active {
    transform: translateY(0);
}

.save-selection-btn {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border-color: rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.save-selection-btn:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.1) 100%);
    border-color: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.image-filename {
    font-size: 0.875rem;
    color: #FFD700;
    font-weight: 500;
    text-align: center;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.file-info {
    flex: 1;
    color: #FFD700;
}

.file-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.file-size {
    font-size: 0.875rem;
    color: #ccc;
}

/* Responsive adjustments for edits mode */
/* <=1024px responsive (grouped at bottom) */

/* <=768px responsive (grouped at bottom) */

/* <=480px responsive (grouped at bottom) */

/* ===== Grouped responsive sections ===== */
/* <= 1024px */
@media (max-width: 1024px) {
  .edits-mode .input-bar {
    left: 260px; /* Account for sidebar being open on tablet - sidebar is 260px wide */
    right: 0; /* Constrain the width */
    width: calc(100vw - 260px); /* Explicitly set width to available space */
    padding: 1rem;
  }
  
  .edits-mode .chat-area {
    padding-bottom: 350px; /* Increased for tablet layout */
    height: calc(100vh - 350px);
  }
  
  /* Mobile layout: mode on top row, textarea full width, buttons side by side */
  .edits-mode .input-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto;
    gap: 1rem;
    grid-template-areas:
      "mode mode mode"
      "textarea textarea textarea"
      "upload upload generate";
  }
  
  .edits-mode .mode-dropdown-section {
    grid-area: mode;
    justify-self: center;
  }
  
  .edits-mode .text-input-section {
    grid-area: textarea;
    width: 100%;
  }
  
  .edits-mode .file-upload-section {
    grid-area: upload;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  
  .edits-mode .generate-section {
    grid-area: generate;
  }
  
  /* Controls sizing */
  .edits-mode .upload-link-btn,
  .edits-mode .file-upload-btn {
    width: 100%;
    min-width: auto;
    min-height: 70px;
    flex-direction: row;
    padding: 1rem;
    font-size: 0.875rem;
    gap: 0.5rem;
  }
  
  .edits-mode .upload-link-btn,
  .edits-mode .file-upload-btn,
  .edits-mode .generate-btn {
    min-height: 60px;
    padding: 0.75rem;
  }
  
  .edits-mode .message-textarea {
    min-height: 80px;
    padding: 1rem;
    font-size: 0.875rem;
    min-width: 200px;
  }
  
  .mode-dropdown-btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }
  
  .mode-dropdown-menu {
    left: -50%;
    right: -50%;
    min-width: 150px;
  }
}

/* <= 768px */
@media (max-width: 768px) {
  /* Unauth modal */
  .unauth-generate-modal-content {
    max-width: 350px;
    margin: 20px;
  }
  .unauth-generate-modal-body {
    padding: 0 20px 25px 20px;
  }
  .unauth-generate-modal-title {
    font-size: 20px;
  }
  .unauth-generate-modal-message {
    font-size: 15px;
  }
  .unauth-generate-modal-buttons {
    flex-direction: column;
    gap: 10px;
  }
  .unauth-generate-modal-btn {
    width: 100%;
  }

  /* Layout */
  .edits-mode .input-bar {
    left: 0; /* No sidebar offset on mobile */
    right: 0; /* Use full width */
    width: 100vw; /* Use full viewport width on mobile */
    padding: 1rem;
  }
  .edits-mode .chat-area {
    padding-bottom: 400px;
    height: calc(100vh - 400px);
  }
  .edits-mode .input-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto;
    gap: 1rem;
    grid-template-areas:
      "mode mode mode"
      "textarea textarea textarea"
      "upload upload generate";
  }
  .edits-mode .mode-dropdown-section {
    grid-area: mode;
    justify-self: center;
  }
  .edits-mode .text-input-section {
    grid-area: textarea;
    width: 100%;
  }
  .edits-mode .file-upload-section {
    grid-area: upload;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .edits-mode .generate-section {
    grid-area: generate;
  }

  /* Controls sizing */
  .edits-mode .upload-link-btn,
  .edits-mode .file-upload-btn {
    width: 100%;
    min-width: auto;
    min-height: 70px;
    flex-direction: row;
    padding: 1rem;
    font-size: 0.875rem;
    gap: 0.5rem;
  }
  .edits-mode .upload-link-btn,
  .edits-mode .file-upload-btn,
  .edits-mode .generate-btn {
    min-height: 60px;
    padding: 0.75rem;
  }
  .edits-mode .message-textarea {
    min-height: 80px;
    padding: 1rem;
    font-size: 0.875rem;
  }
  .mode-dropdown-btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }
  .edits-mode .welcome-message .message-text h3 {
    font-size: 1rem;
  }
  .edits-mode .welcome-main-text { font-size: 1rem; margin-top: 0.25rem; }
  .edits-mode .welcome-sub-text { font-size: 0.9rem; }
  .mode-dropdown-menu {
    left: -50%;
    right: -50%;
    min-width: 150px;
  }

  /* Media content */
  .uploaded-image-container {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  .uploaded-image {
    max-height: 200px;
  }
  .image-filename {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
  }
  .image-controls {
    gap: 0.5rem;
    flex-direction: column;
  }
  .selection-btn,
  .save-selection-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    min-height: 36px;
    width: 100%;
    justify-content: center;
  }
  .selection-canvas {
    touch-action: none;
  }
}

/* <= 480px */
@media (max-width: 480px) {
  /* Unauth modal */
  .unauth-generate-modal-content {
    max-width: 90%;
    border-radius: 16px;
  }
  .unauth-generate-modal-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
  }
  .unauth-generate-modal-icon svg {
    width: 32px;
    height: 32px;
  }
  .unauth-generate-modal-title {
    font-size: 18px;
  }
  .unauth-generate-modal-message {
    font-size: 14px;
    margin-bottom: 24px;
  }

  /* Layout: tighter spacing between mode and textarea */
  .edits-mode .input-bar {
    padding: 0.75rem;
  }
  .edits-mode .chat-area {
    padding-bottom: 450px;
    height: calc(100vh - 450px);
  }
  .edits-mode .input-container {
    gap: 0.5rem;
  }
  .mode-dropdown-section {
    margin-bottom: 0.3rem;
  }

  /* Controls sizing */
  .edits-mode .upload-link-btn,
  .edits-mode .file-upload-btn,
  .edits-mode .generate-btn {
    min-height: 60px;
    padding: 0.75rem;
    font-size: 0.75rem;
  }
  .edits-mode .mode-dropdown-btn {
    min-height: 30px;
    padding: 0.6rem;
    font-size: 0.8rem;
  }
  .edits-mode .message-textarea {
    min-height: 50px;
    padding: 0.75rem;
    font-size: 0.8rem;
  }

  /* Credit pill parity */
  .credit-balance-pill {
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 14px;
    gap: 4px;
  }

  /* Welcome message parity */
  .edits-mode .welcome-message .message-text h3 {
    font-size: 0.85rem;
  }
  .edits-mode .welcome-main-text { font-size: 0.95rem; }
  .edits-mode .welcome-sub-text { font-size: 0.85rem; }

  /* Media content */
  .uploaded-image-container {
    padding: 0.5rem;
    gap: 0.4rem;
  }
  .uploaded-image {
    max-height: 150px;
  }
  .image-filename {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
  }
}