/* Container */
.BrandIdentitySelector_container__IXgWl {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Selector wrapper */
.BrandIdentitySelector_selectorWrapper__97y0F {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.BrandIdentitySelector_select__FEOF8 {
  flex: 1 1;
  padding: 0.625rem 0.875rem;
  background-color: #343541;
  border: 1px solid #40414F;
  border-radius: 0.375rem;
  color: #ECECEC;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.BrandIdentitySelector_select__FEOF8:hover {
  border-color: #565869;
}

.BrandIdentitySelector_select__FEOF8:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.BrandIdentitySelector_select__FEOF8:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.BrandIdentitySelector_loadingText__Z_TMo {
  font-size: 0.8rem;
  color: #AEAEB5;
}

.BrandIdentitySelector_errorText__6DNmL {
  font-size: 0.8rem;
  color: #ef4444;
}

/* Preview area - Compact */
.BrandIdentitySelector_preview__NpyW1 {
  background-color: rgba(168, 255, 120, 0.05);
  border: 1px solid rgba(168, 255, 120, 0.2);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.BrandIdentitySelector_previewHeaderCompact__HVOcB {
  display: flex;
  align-items: center;
}

.BrandIdentitySelector_previewName__VNN9_ {
  color: #ECECEC;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Compact row layout */
.BrandIdentitySelector_previewRow__ZdB1F {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Color swatches - Smaller */
.BrandIdentitySelector_colorSwatches__dDK4v {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.BrandIdentitySelector_colorSwatch__43rGW {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  cursor: help;
  transition: all 0.2s;
  flex-shrink: 0;
}

.BrandIdentitySelector_colorSwatch__43rGW:hover {
  transform: scale(1.15);
  border-color: rgba(255, 255, 255, 0.4);
}

.BrandIdentitySelector_moreIndicator__D6bum {
  font-size: 0.7rem;
  color: #AEAEB5;
  font-weight: 500;
  margin-left: 0.125rem;
}

/* Font list - Compact inline */
.BrandIdentitySelector_fontListCompact__5EHsN {
  display: flex;
  align-items: center;
}

.BrandIdentitySelector_previewValue__R0mv0 {
  font-size: 0.75rem;
  color: #AEAEB5;
}

/* Image thumbnails - Smaller */
.BrandIdentitySelector_imageThumbnails__2aMn1 {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

.BrandIdentitySelector_thumbnail__rCSuG {
  width: 1.75rem;
  height: 1.75rem;
  object-fit: cover;
  border-radius: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s;
  flex-shrink: 0;
}

.BrandIdentitySelector_thumbnail__rCSuG:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.BrandIdentitySelector_moreImages__q5YeY {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 0.25rem;
  font-size: 0.65rem;
  color: #AEAEB5;
  font-weight: 500;
}


/* Modal overlay */
.BrandIdentityManager_overlay__2aZ56 {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}

/* Modal container */
.BrandIdentityManager_modal__ZDgqI {
  background-color: #2D2E35;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border: 1px solid #40414F;
}

/* Header */
.BrandIdentityManager_header__UQjkA {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #40414F;
}

.BrandIdentityManager_title__6Fi8h {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ECECEC;
  margin: 0;
}

.BrandIdentityManager_closeButton__vrXNN {
  background: none;
  border: none;
  font-size: 2rem;
  color: #AEAEB5;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: all 0.2s;
}

.BrandIdentityManager_closeButton__vrXNN:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ECECEC;
}

/* Content area */
.BrandIdentityManager_content__Lm5c6 {
  flex: 1 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Error message */
.BrandIdentityManager_error__AES7A {
  background-color: #fee2e2;
  border: 1px solid #f87171;
  color: #b91c1c;
  padding: 0.75rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

/* List view */
.BrandIdentityManager_listView__9t0Um {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.BrandIdentityManager_listHeader__ysXRO {
  display: flex;
  justify-content: flex-end;
}

.BrandIdentityManager_loading__QFzjY {
  text-align: center;
  color: #AEAEB5;
  padding: 2rem;
}

.BrandIdentityManager_emptyState__KXE62 {
  text-align: center;
  color: #AEAEB5;
  padding: 3rem 2rem;
}

.BrandIdentityManager_emptyState__KXE62 p {
  margin: 0.5rem 0;
}

.BrandIdentityManager_brandList__Mc9ia {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.BrandIdentityManager_brandCard__duCyW {
  background-color: #343541;
  border: 1px solid #40414F;
  border-radius: 0.5rem;
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: all 0.2s;
}

.BrandIdentityManager_brandCard__duCyW:hover {
  border-color: #565869;
  background-color: #3A3B47;
}

.BrandIdentityManager_brandInfo__UHiJD {
  flex: 1 1;
}

.BrandIdentityManager_brandName__Z3kbg {
  font-size: 1.125rem;
  font-weight: 600;
  color: #ECECEC;
  margin: 0 0 0.5rem 0;
}

.BrandIdentityManager_brandDescription__Ljmws {
  color: #AEAEB5;
  font-size: 0.875rem;
  margin: 0 0 0.75rem 0;
  line-height: 1.5;
}

.BrandIdentityManager_brandMeta__x9GRZ {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.BrandIdentityManager_metaBadge__FwCVH {
  background-color: rgba(168, 255, 120, 0.1);
  color: #a8ff78;
  padding: 0.25rem 0.625rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.BrandIdentityManager_brandActions__XGktZ {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Edit view */
.BrandIdentityManager_editView__SJk82 {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.BrandIdentityManager_formGroup__L_k6E {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.BrandIdentityManager_label__h1fLU {
  font-size: 0.875rem;
  font-weight: 500;
  color: #ECECEC;
}

.BrandIdentityManager_hint__l56Ib {
  font-size: 0.8rem;
  color: #AEAEB5;
  margin: 0;
}

.BrandIdentityManager_input__Wswzy,
.BrandIdentityManager_textarea__wNHMZ {
  width: 100%;
  padding: 0.75rem;
  background-color: #343541;
  border: 1px solid #40414F;
  border-radius: 0.375rem;
  color: #ECECEC;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.BrandIdentityManager_input__Wswzy:focus,
.BrandIdentityManager_textarea__wNHMZ:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.BrandIdentityManager_textarea__wNHMZ {
  resize: vertical;
  font-family: inherit;
}

/* Array inputs (fonts) */
.BrandIdentityManager_arrayInput__8A5vP {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Toggle buttons for font selection mode */
.BrandIdentityManager_toggleGroup__mwxUO {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.BrandIdentityManager_toggleButton__rVdGO {
  flex: 1 1;
  padding: 0.5rem 1rem;
  background-color: transparent;
  border: 1px solid #40414F;
  border-radius: 0.375rem;
  color: #AEAEB5;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.BrandIdentityManager_toggleButton__rVdGO:hover {
  border-color: #565869;
  color: #ECECEC;
}

.BrandIdentityManager_toggleButtonActive__QsN2o {
  background-color: rgba(168, 255, 120, 0.1);
  border-color: #a8ff78;
  color: #a8ff78;
}

/* Token list for displaying added fonts/colors */
.BrandIdentityManager_tokenList__gTT_T {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.BrandIdentityManager_token__0eGST {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(168, 255, 120, 0.1);
  border: 1px solid rgba(168, 255, 120, 0.3);
  border-radius: 0.375rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.85rem;
  color: #ECECEC;
}

.BrandIdentityManager_tokenText__Whst6 {
  color: #ECECEC;
}

.BrandIdentityManager_tokenRemove__KAuxQ {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  margin-left: 0.25rem;
  transition: all 0.2s;
}

.BrandIdentityManager_tokenRemove__KAuxQ:hover {
  color: #dc2626;
  transform: scale(1.2);
}

/* Color-specific token styles */
.BrandIdentityManager_colorToken__tqoRE {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(168, 255, 120, 0.1);
  border: 1px solid rgba(168, 255, 120, 0.3);
  border-radius: 0.375rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.85rem;
}

.BrandIdentityManager_colorSwatch__l42_2 {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.25rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.BrandIdentityManager_hexValue__fGkMT {
  color: #AEAEB5;
  font-size: 0.8rem;
}

/* Color input group */
.BrandIdentityManager_colorInputGroup__pUu5_ {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

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

.BrandIdentityManager_colorPicker__JKy6u {
  width: 4rem;
  height: 4rem;
  border: 2px solid #40414F;
  border-radius: 0.5rem;
  cursor: pointer;
  background: none;
}

.BrandIdentityManager_colorPicker__JKy6u:hover {
  border-color: #565869;
}

.BrandIdentityManager_colorPickerLabel__JZSXw {
  font-size: 0.75rem;
  color: #AEAEB5;
}

.BrandIdentityManager_colorTextInputs__qqwzW {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 200px;
}

.BrandIdentityManager_colorPreview__QNOu4 {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.375rem;
  border: 2px solid #40414F;
  flex-shrink: 0;
}

/* Image grid */
.BrandIdentityManager_imageGrid__dzC89 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  grid-gap: 1rem;
  gap: 1rem;
  margin-bottom: 1rem;
}

.BrandIdentityManager_imageCard__rHnQL {
  position: relative;
  aspect-ratio: 1;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 2px solid #40414F;
  transition: all 0.2s;
}

.BrandIdentityManager_imageCard__rHnQL:hover {
  border-color: #565869;
}

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

.BrandIdentityManager_imageDeleteButton__H5GvC {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background-color: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.BrandIdentityManager_imageDeleteButton__H5GvC:hover {
  background-color: rgba(220, 38, 38, 1);
  transform: scale(1.1);
}

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

/* Buttons */
.BrandIdentityManager_primaryButton___QZ1q {
  background-color: #4f46e5;
  color: white;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.BrandIdentityManager_primaryButton___QZ1q:hover {
  background-color: #4338ca;
}

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

.BrandIdentityManager_secondaryButton__bID_X {
  background-color: transparent;
  color: #ECECEC;
  padding: 0.625rem 1.25rem;
  border: 1px solid #40414F;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.BrandIdentityManager_secondaryButton__bID_X:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: #565869;
}

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

.BrandIdentityManager_dangerButton__ppnmU {
  background-color: transparent;
  color: #ef4444;
  padding: 0.625rem 1.25rem;
  border: 1px solid #ef4444;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.BrandIdentityManager_dangerButton__ppnmU:hover {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: #dc2626;
  color: #dc2626;
}

.BrandIdentityManager_addButton__CozTa {
  background-color: transparent;
  color: #a8ff78;
  padding: 0.5rem 1rem;
  border: 1px dashed #a8ff78;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  align-self: flex-start;
}

.BrandIdentityManager_addButton__CozTa:hover {
  background-color: rgba(168, 255, 120, 0.1);
}

.BrandIdentityManager_addButton__CozTa:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: transparent;
  color: #AEAEB5;
  border-color: #40414F;
}

.BrandIdentityManager_addButtonActive__W14pe {
  background-color: rgba(168, 255, 120, 0.15);
  border-style: solid;
  border-color: #a8ff78;
  color: #d7ffd0;
  box-shadow: 0 0 10px rgba(168, 255, 120, 0.2);
}

.BrandIdentityManager_removeButton__NaHXB {
  background-color: transparent;
  color: #ef4444;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ef4444;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.BrandIdentityManager_removeButton__NaHXB:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

.BrandIdentityManager_formActions__DAsd6 {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #40414F;
}


/* Container for the entire page */
.page_container__4nunL {
  max-width: 1200px; /* Adjust as needed */
  margin: 0 auto;
  padding: 1.5rem;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
}

/* Form styling */
.page_form__GSC3Z {
  margin-bottom: 2rem;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
}

.page_formLabel__dWP2p {
  display: block;
  font-size: 0.875rem; /* text-sm */
  font-weight: 500; /* font-medium */
  color: #374151; /* text-gray-700 */
  margin-bottom: 0.25rem;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
}

.page_textarea__x1qFz,
.page_select___dv3Y {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db; /* border-gray-300 */
  border-radius: 0.375rem; /* rounded-md */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
  margin-bottom: 1rem;
}

.page_textarea__x1qFz:focus,
.page_select___dv3Y:focus {
  outline: none;
  border-color: #4f46e5; /* focus:border-indigo-500 */
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.5); /* focus:ring-indigo-500 */
}

.page_button__kdKFB {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  font-size: 0.875rem; /* text-sm */
  font-weight: 500; /* font-medium */
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  border-radius: 0.375rem; /* rounded-md */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
  color: #ffffff; /* text-white */
  background-color: #4f46e5; /* bg-indigo-600 */
  cursor: pointer;
}

.page_button__kdKFB:hover {
  background-color: #4338ca; /* hover:bg-indigo-700 */
}

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

/* Error message */
.page_error__bQ53e {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: #fee2e2; /* bg-red-100 */
  border: 1px solid #f87171; /* border-red-400 */
  color: #b91c1c; /* text-red-700 */
  border-radius: 0.375rem; /* rounded */
}

/* Results section */
.page_resultsContainer__b6Mgb {
  width: 100%;
  flex-grow: 1; /* Allow results to take available space if welcome/error not shown */
  display: flex; /* Added for flex-direction */
  flex-direction: column; /* Ensure header and scroll container stack */
}

.page_resultsHeader__kraiX {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1.5rem 0 1rem 0; /* Adjust padding */
  border-bottom: 1px solid #40414F;
  color: #ECECEC;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 20; /* High z-index to stay on top */
  background-color: #343541; /* Match main content background */
}

.page_resultsActions__YMaHN {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.page_voiceAndGenerateGroup__bMmkf {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page_voiceSelectorGroup__iGnrH {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.page_inlineLabel__FUWG2 {
  font-size: 0.85rem;
  color: #AEAEB5;
}

.page_voiceSelect__n8IQN {
  background-color: #2D2E35;
  border: 1px solid #40414F;
  color: #ECECEC;
  border-radius: 0.375rem;
  padding: 0.35rem 0.5rem;
}

.page_voicePreviewButton__XtsHw {
  padding: 0.45rem 0.6rem;
  background-color: #4A4A4A;
  border: 1px solid #5A5A5A;
  color: #ECECEC;
  border-radius: 0.5rem;
  cursor: pointer;
}

.page_voicePreviewButton__XtsHw:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.page_resultsTitleContainer___ytAY {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page_resultsTitle__4kwr_ {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  margin: 0;
  flex-direction: column;
}

.page_unselectButton__tpSJI {
  padding: 0.8rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #AEAEB5; /* Lighter, more subtle text color */
  background-color: #2D2E35; /* Darker, neutral background */
  border: 1px solid #40414F; /* Subtle border */
  border-radius: 0.5rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page_unselectButton__tpSJI:hover:not(:disabled) {
  background-color: #3A3B3D;
  color: #ECECEC;
  border-color: #4A4A4A;
  transform: translateY(-1px);
}

.page_unselectButton__tpSJI:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #2A2B32;
}

.page_downloadButton__Nf2VF {
  padding: 0.8rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #fff;
  background-color: #22c55e; /* Bright green for main action */
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(34,197,94,0.15);
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
}

.page_downloadButton__Nf2VF:hover:not(:disabled) {
  background-color: #16a34a;
  box-shadow: 0 4px 16px rgba(34,197,94,0.25);
  transform: translateY(-2px) scale(1.03);
}

.page_downloadButton__Nf2VF:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Chunk layout */
.page_chunksScrollContainer__AvI3T {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  overflow-x: auto;
  padding-top: 1rem;
  padding-bottom: 1.5rem;
}

.page_chunkCard__izv6F {
  width: 380px;
  flex-shrink: 0;
  background-color: #2A2B32;
  border-radius: 0.75rem;
  border: 1px solid #4A4A4A;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.page_chunkCard__izv6F:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}

.page_chunkHeader__hMpTI {
  margin-bottom: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.page_chunkHeaderSticky__Pyn5d {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  background-color: #2A2B32;
  z-index: 10;
  padding: 1.25rem 1.25rem 1rem 1.25rem; /* More padding around the header */
  border-bottom: 1px solid #40414F;
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* Align items to the top */
  gap: 1rem; /* Add gap between content and button */
}

.page_chunkHeaderContent__Z_pYe {
  flex-grow: 1; /* Take up remaining space */
  min-width: 0; /* Allow content to shrink */
}

.page_chunkLabel__jvjLG {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #AEAEB5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem 0; /* More margin bottom */
}

.page_chunkText__1FXWM {
  font-weight: 500;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #ECECEC;
  font-size: 0.9rem;
  line-height: 1.5; /* Better line height for readability */
  margin: 0; /* Remove all margins */
  padding-right: 0.5rem; /* Add some padding so text doesn't touch button */
}

/* Chunklet layout */
.page_chunkletsContainer__TBqzs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Responsive grid */
  grid-gap: 1.5rem;
  gap: 1.5rem; /* Consistent gap */
  width: 100%;
}

.page_chunkletCard__RLHIv {
  background-color: #2D2E35; /* Dark theme background */
  border-radius: 0.75rem; /* rounded-xl */
  border: 1px solid #40414F; /* Consistent with theme */
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1); /* Subtle shadow */
  padding: 1rem; /* More padding */
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative; /* For absolute positioned text overlay */
  aspect-ratio: 1; /* Make cards square */
  width: 100%; /* Full width of container */
}

.page_chunkletCard__RLHIv:hover {
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.15); /* Enhanced shadow on hover */
  transform: translateY(-1px); /* Subtle lift effect */
}

/* Show text on hover */
.page_chunkletCard__RLHIv:hover .page_chunkletText__hfQCk {
  opacity: 1;
  visibility: visible;
}

.page_chunkletHeader__uRoPx {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.page_chunkletCheckbox__hxeFK {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: #4f46e5;
}

.page_chunkletLabel__elb5P {
  width: 100%;
  font-size: 0.7rem; /* Smaller text */
  font-weight: 600; /* font-semibold */
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #AEAEB5; /* Consistent with theme */
  margin-bottom: 0.25rem; /* Less spacing to focus on images */
  text-align: center; /* Center align for cleaner look */
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.page_chunkletText__hfQCk {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem;
  font-size: 0.875rem;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #ECECEC;
  font-style: italic;
  background-color: rgba(45, 46, 53, 0.95); /* Semi-transparent overlay */
  border-radius: 0.75rem;
  opacity: 0; /* Hidden by default */
  visibility: hidden; /* Hidden by default */
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
  z-index: 10;
}

.page_chunkletImageContainer___CwsB {
  width: 100%;
  height: 100%;
  flex-grow: 1; /* Take remaining space */
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative; /* For positioning the download button */
}

.page_individualDownloadButton___Gsmd {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.5rem;
  background-color: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 0.375rem;
  color: white;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page_individualDownloadButton___Gsmd:hover {
  background-color: rgba(0, 0, 0, 0.85);
  transform: scale(1.05);
}

.page_chunkletImageContainer___CwsB:hover .page_individualDownloadButton___Gsmd {
  opacity: 1;
  visibility: visible;
}

.page_chunkletImage___tp7e {
  border-radius: 0.5rem; /* rounded-lg */
  object-fit: contain;
  border: 1px solid #40414F; /* Consistent with theme */
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1); /* Consistent shadow */
  width: 100%; /* Full width of container */
  height: 100%; /* Full height of container */
}

.page_imageError__GXgt_ {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column; /* To stack text */
  padding: 1rem;
  text-align: center;
}

.page_statusIndicator__S3PMQ, .page_statusIndicatorLight__3dsJa {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column; /* Stack spinner above text */
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem; /* Match parent */
  text-align: center;
  padding: 1rem;
}

.page_statusIndicator__S3PMQ {
  background-color: rgba(30, 31, 35, 0.85);
  color: #c7c7c7;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  font-weight: 500;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
}

.page_statusIndicatorLight__3dsJa {
  background-color: rgba(45, 46, 53, 0.85);
  color: #e0e0e0;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  font-weight: 500;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
}

.page_statusFailed__jpSRV {
  background-color: rgba(69, 29, 29, 0.8);
  color: #f87171;
}

/* Selected and disabled chunklet states */
.page_selectedChunklet__hFckQ {
  border-color: #22c55e !important;
  background-color: rgba(34, 197, 94, 0.05) !important;
}

.page_disabledChunklet__ZcAWd {
  opacity: 0.6;
  cursor: not-allowed !important;
}

.page_generateMoreImagesButton__sdxl5 {
  flex-shrink: 0; /* Don't shrink */
  padding: 0.5rem 1rem; /* More padding for better clickability */
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #ECECEC;
  background-color: #4A4A4A; /* Consistent with design theme */
  border: 1px solid #5A5A5A;
  border-radius: 0.5rem; /* More rounded */
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap; /* Prevent text wrap */
  height: -moz-fit-content;
  height: fit-content; /* Maintain button height */
}

.page_generateMoreImagesButton__sdxl5:hover:not(:disabled) {
  background-color: #5A5A5A;
  border-color: #6A6A6A;
  transform: translateY(-1px); /* Subtle lift effect */
}

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

/* Add a custom scrollbar style for horizontal scrolling */
.page_chunksScrollContainer__AvI3T::-webkit-scrollbar {
  height: 8px;
}

.page_chunksScrollContainer__AvI3T::-webkit-scrollbar-track {
  background: #2c2c2e;
  border-radius: 4px;
}

.page_chunksScrollContainer__AvI3T::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 4px;
  border: 2px solid #2c2c2e;
}

.page_chunksScrollContainer__AvI3T::-webkit-scrollbar-thumb:hover {
  background-color: #666;
}

/* New styles for View Mode Toggle */
.page_viewModeToggle__Gb55N {
  display: flex;
  align-items: center;
  background-color: #2a2a2e;
  border-radius: 8px;
  padding: 4px;
  border: 1px solid #3a3a3c;
}

.page_toggleButton__MtKP9 {
  background-color: transparent;
  border: none;
  color: #aeb1b8;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
  font-size: 0.85rem;
}

.page_toggleButton__MtKP9.page_activeToggle__b5DbU {
  background-color: #4a4a50;
  color: #ffffff;
}

.page_generateVideoButton__kSxFl {
  background-color: #4DA3FF;
  color: #fff;
  border: none;
  padding: 0.9rem 1.4rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 260px;
  box-shadow: 0 6px 14px rgba(77, 163, 255, 0.3);
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.page_generateVideoButton__kSxFl:hover:not(:disabled) {
  background-color: #2f95ff;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(77, 163, 255, 0.35);
}

.page_generateVideoButton__kSxFl:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Loading state */
.page_buttonLoading__uLDAx {
  position: relative;
}

.page_buttonSpinner__D0pUn {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  margin-right: 0.6rem;
  animation: page_spin__wygAS 0.9s linear infinite;
}

@keyframes page_spin__wygAS {
  to { transform: rotate(360deg); }
}

.page_videoSuccessMessage__8Kxih {
  background-color: #2e7d32;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page_videoSuccessMessage__8Kxih p {
  margin: 0;
  font-weight: 500;
}

.page_videoLink___bWep {
  color: white;
  background-color: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s;
}

.page_videoLink___bWep:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.page_closeVideoMessage__vEL34 {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
  opacity: 0.8;
}

.page_closeVideoMessage__vEL34:hover {
  opacity: 1;
}

/* NEW STYLES FOR CHATGPT INTERFACE */

/* Overall Page Container */
.page_chatGptContainer__rU1RH {
  display: flex;
  /* Deduct the site header height so the main workspace always fits
     inside the viewport.  This removes the body-scroll edge-case that
     allowed the sidebar / input panel to scroll the whole page and
     push the project header out of view, breaking its sticky
     behaviour.  Adjust this value if the header height changes. */
  height: calc(100vh - 80px); /* 80px ≈ header height */
  width: 100%;
  background-color: #343541;
  color: #ECECEC;
  font-family: var(--font-geist-sans); /* Use consistent Geist Sans font */
  overflow: hidden;
}

/* Original Far-Left Sidebar (e.g., for New Task, History) */
.page_sidebar__zU6ul {
  position: static;
  width: 280px; /* Desktop width */
  height: 100vh;
  background-color: #202123;
  color: #ECECEC;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid #40414F;
  flex-shrink: 0;
}

/* Styles for elements within .sidebar (header, nav, items, footer) should be re-checked if broken */
/* For example: */
.page_sidebarHeader__2rMjc { position: relative; margin-bottom: 1.5rem; padding: 1rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }

.page_newChatButton__4JxYx {
  display: flex;
  align-items: center;
  gap: 0.75rem; /* Increased gap for better spacing */
  justify-content: center; /* Center content */
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: none; /* No border needed with a solid background */
  background-color: #4F46E5; /* Primary action color */
  color: #FFFFFF; /* White text for high contrast */
  font-size: 0.9rem;
  font-weight: 600; /* Bolder font */
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: center; /* Center text */
}

.page_newChatButton__4JxYx:hover {
  background-color: #4338CA; /* Darker shade on hover */
}

.page_sidebarNav__5jic1 { flex-grow: 1; overflow-y: auto; }
.page_sidebarSection__ZgHm2 { margin-bottom: 1.5rem; }
.page_sidebarSectionTitle__ThdC_ { font-size: 0.75rem; font-family: var(--font-geist-sans); color: #8E8EA0; text-transform: uppercase; padding: 0 0.5rem; margin-bottom: 0.5rem; }
.page_sidebarItem__kHnHP { padding: 0.6rem 0.75rem; border-radius: 0.375rem; cursor: pointer; font-size: 0.875rem; font-family: var(--font-geist-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background-color 0.2s; }
.page_sidebarItem__kHnHP:hover { background-color: #2A2B32; }
.page_sidebarFooter__pWI6n { padding: 1rem 0.5rem; font-size: 0.875rem; font-family: var(--font-geist-sans); border-top: 1px solid #3A3B3D; margin-top: auto; }

/* Style for active project in sidebar */
.page_activeProject__RNDxu {
  background-color: #343541;
  font-weight: bold;
}

/* Empty state styling */
.page_sidebarEmptyState__ROgMQ {
  padding: 1.5rem 0.75rem;
  text-align: center;
  color: #8E8EA0;
}

.page_sidebarEmptyIcon__XEEXg {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.page_sidebarEmptyText__jrpPI {
  font-size: 0.875rem;
  font-family: var(--font-geist-sans);
}

/* Style for error message in sidebar */
.page_sidebarError__EJ4jf {
  color: #ff6b6b; /* A light red for error text */
  padding: 10px 15px;
  font-size: 0.9rem;
  border-left: 3px solid #ff6b6b;
}

/* Dimmed error style during generation */
.page_sidebarErrorDimmed__zu0Cx {
  opacity: 0.6 !important;
  background-color: #2a1a1a !important;
}

/* Style for project that is currently generating */
.page_generatingProject__6OF1B {
  border-left: 3px solid #4F46E5 !important;
  background-color: #1e1f3a !important;
}

/* Generating indicator */
.page_generatingIndicator__LHVEB {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.75rem;
  animation: page_pulse__FkCDM 2s infinite;
}

@keyframes page_pulse__FkCDM {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Main Content Area - Flex ROW container */
.page_mainContent__CS_Du {
  flex-grow: 1;
  display: flex; /* Changed to flex */
  height: 100vh;
  position: relative;
  overflow: hidden; /* Prevent body scroll with overflow-y: auto on children */
}

.page_mainContent__CS_Du.page_withTimeline__XSNMR {
  padding-bottom: 180px;
}

.page_mainContent__CS_Du.page_withTimeline__XSNMR.page_withCompactTimeline__zSNs_ {
  padding-bottom: 120px;
}

/* NEW: Input Panel (contains the form) */
.page_inputPanel__MFxII {
  width: 380px; /* Fixed width for the form panel */
  flex-shrink: 0; 
  height: auto; /* Let panel grow naturally */
  background-color: #202123; /* Same dark background as original sidebar */
  padding: 1rem; /* Reduced from 1.5rem for more compact layout */
  box-sizing: border-box;
  overflow-y: auto; 
  border-right: 1px solid #40414F; 
  display: flex; 
  flex-direction: column;
}

.page_imageGenerationForm__rCHjH { /* Form now lives in inputPanel */
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem; /* Minimal gap for maximum compactness */
  flex-grow: 1; /* Allow form to take space, helps button stick to bottom if panel scrolls */
  /* background-color: transparent; /* Form itself is transparent */
  /* border: none; */
}

.page_inputControlsContainer__pwLQ_ { 
  display: flex;
  flex-direction: column; 
  gap: 0.125rem; /* Minimal gap for maximum compactness */
  width: 100%;
}

.page_formGroup__7oW5j {
  margin-bottom: 0; /* Remove all margin for maximum compactness */
  display: flex;
  flex-direction: column;
}

.page_inputError__EHwd1 {
  border-color: #F44336 !important;
  box-shadow: 0 0 5px rgba(244, 67, 54, 0.5);
}

.page_mainTextarea__o5lit.page_inputError__EHwd1 {
  border: 1px solid #e53e3e;
}

.page_inputLabel__2dgHA {
  font-size: 0.75rem; /* Smaller font size for maximum compactness */
  font-weight: 600;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #AEAEB5;
  display: flex; /* Or other appropriate display type */
  margin-bottom: 0.125rem; /* Minimal margin below labels */
}

/* Brand identity inputs to keep generation on-brand for marketers */
.page_brandSection__ufp_9 {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(79, 70, 229, 0.08);
  border: 1px dashed rgba(99, 102, 241, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.page_brandSectionCollapsed__WFnvq {
  gap: 0.25rem;
}

.page_brandSectionOpen__V6l5f {
  gap: 0.75rem;
}

.page_brandToggle__q0GUB {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: rgba(63, 56, 168, 0.35);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 0.6rem;
  color: #ececec;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.page_brandToggle__q0GUB:hover {
  background: rgba(99, 102, 241, 0.45);
  border-color: rgba(129, 140, 248, 0.7);
}

.page_brandToggleIcon__gGFmi {
  font-size: 1.2rem;
  line-height: 1;
}

.page_brandContent__cvLzC {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.page_brandHelper__ueMqZ {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #d1d1d8;
}

.page_brandField__mDqGQ {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.page_brandLabel__FMDfo {
  font-size: 0.72rem;
  font-weight: 600;
  color: #d1d1d8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page_brandHint__lOsgc {
  margin: 0;
  font-size: 0.68rem;
  color: #9CA3AF;
}

.page_brandInputRow___l0db {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page_brandColorRow__vXf9m {
  align-items: stretch;
}

.page_brandTextInput__SkOPd {
  flex: 1 1;
}

.page_brandAddButton__m9Mo_ {
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: #4F46E5;
  border: none;
  border-radius: 0.5rem;
  color: #F5F5FF;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}

.page_brandAddButton__m9Mo_:hover:not(:disabled) {
  background: #6366F1;
  transform: translateY(-1px);
}

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

.page_brandTokenList__rSqXz {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page_brandToken__hQ5Ff {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: #262730;
  border: 1px solid #3F3F4B;
  color: #ECECEC;
  font-size: 0.75rem;
}

.page_brandTokenText__tWN_d {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.page_brandTokenRemove__iSxRm {
  border: none;
  background: transparent;
  color: #bbbbc6;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
}

.page_brandTokenRemove__iSxRm:hover {
  color: #f87171;
}

.page_brandColorInput__dy6_v {
  width: 48px;
  height: 40px;
  border: 1px solid #40414F;
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.page_brandColorSwatch__6ZcsZ {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: inline-block;
}

.page_brandColorHex__qZxBP {
  font-size: 0.7rem;
  color: #9CA3AF;
}

/* Brand image upload styles */
.page_brandFileInput__cxeSj {
  display: none;
}

.page_brandFileLabel__HuISq {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: #4F46E5;
  border: none;
  border-radius: 0.5rem;
  color: #F5F5FF;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  text-align: center;
}

.page_brandFileLabel__HuISq:hover {
  background: #6366F1;
  transform: translateY(-1px);
}

.page_brandImagePreviewContainer__5eXTA {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.page_brandImagePreview__qmdP6 {
  max-width: 100%;
  max-height: 200px;
  border-radius: 0.5rem;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.page_brandImageRemove__YC_D2 {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(244, 67, 54, 0.9);
  border: none;
  border-radius: 0.4rem;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.page_brandImageRemove__YC_D2:hover {
  background: rgba(244, 67, 54, 1);
}

.page_brandPreview__oxVsg {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.25rem;
}

.page_brandPreviewLabel__H8gZ0 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #A0A5B5;
}

.page_brandPreviewTextarea__f_OKK {
  background: #2D2E35;
  border: 1px solid #40414F;
  border-radius: 0.5rem;
  padding: 0.5rem;
  resize: vertical;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #ECECEC;
  width: 100%;
  box-sizing: border-box;
}

/* Common styling for input elements (textareas, select) */
.page_smallTextarea__T9wK5,
.page_imageSizeSelect__dKWSD,
.page_mainTextarea__o5lit,
.page_textInputShort__lRVp7 {
  font-size: 0.9rem; /* Consistent font size for inputs */
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #ECECEC;
  line-height: 1.5;
  padding: 0.4rem; /* Further reduced padding for maximum compactness */
  background-color: #2D2E35; /* Input background - distinct from panel */
  border: 1px solid #40414F; /* Border for inputs */
  border-radius: 0.375rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
}

/* Consistent placeholder styles for all input elements */
.page_smallTextarea__T9wK5::placeholder,
.page_imageSizeSelect__dKWSD::placeholder,
.page_mainTextarea__o5lit::placeholder,
.page_textInputShort__lRVp7::placeholder,
.page_contextTextarea__fbzSX::placeholder {
  font-size: 0.9rem; /* Match input font size */
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #6B7280; /* Subtle gray color for placeholders */
  opacity: 1; /* Ensure full opacity across browsers */
}

.page_smallTextarea__T9wK5:focus,
.page_imageSizeSelect__dKWSD:focus,
.page_mainTextarea__o5lit:focus {
  border-color: #4F46E5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
}

/* Specifics for textareas */
.page_contextTextarea__fbzSX {
  min-height: 28px; /* Ultra compact height */
  resize: vertical;
}
.page_mainTextarea__o5lit {
  min-height: 36px; /* Very compact minimum height */
  max-height: 300px; /* Increased max height for longer narrations */
  overflow-y: auto;
  resize: vertical; 
  /* Enhanced styling to make it more prominent */
  background-color: #3A3B42; /* Slightly lighter background than other inputs */
  border: 2px solid #4F46E5; /* More prominent border with theme color */
  box-shadow: 0 0 8px rgba(79, 70, 229, 0.15); /* Subtle glow effect */
  position: relative;
  transition: all 0.3s ease;
  font-size: 1rem; /* Slightly larger font size */
  line-height: 1.6; /* Better line spacing for readability */
}

.page_mainTextarea__o5lit:focus {
  border-color: #6366F1; /* Brighter focus color */
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3), 0 0 12px rgba(79, 70, 229, 0.2); /* Enhanced focus glow */
  background-color: #404148; /* Slightly brighter on focus */
}

.page_mainTextarea__o5lit.page_inputError__EHwd1 {
  border-color: #e53e3e;
  box-shadow: 0 0 8px rgba(229, 62, 62, 0.2);
  background-color: #3A2E2E; /* Subtle red tint for error state */
}

.page_mainTextarea__o5lit.page_inputError__EHwd1:focus {
  border-color: #e53e3e;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.4), 0 0 12px rgba(229, 62, 62, 0.2);
}

/* Make the label for the main textarea more prominent */
.page_mainTextarea__o5lit + .page_inputLabel__2dgHA,
.page_formGroup__7oW5j:has(.page_mainTextarea__o5lit) .page_inputLabel__2dgHA {
  font-size: 0.85rem; /* Slightly smaller font for compactness */
  font-weight: 700; /* Bolder weight */
  color: #E5E7EB; /* Brighter color */
  margin-bottom: 0.125rem; /* Minimal margin for maximum compactness */
  text-transform: uppercase; /* Make it stand out */
  letter-spacing: 0.5px; /* Slight letter spacing */
}

/* Add a subtle highlight effect around the main textarea container */
.page_formGroup__7oW5j:has(.page_mainTextarea__o5lit) {
  padding: 0.125rem; /* Absolute minimal padding */
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(79, 70, 229, 0.02) 100%);
  border: 1px solid rgba(79, 70, 229, 0.15);
  margin: 0; /* Remove all margin for maximum compactness */
  transition: all 0.3s ease;
  position: relative;
}

.page_formGroup__7oW5j:has(.page_mainTextarea__o5lit):hover {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(79, 70, 229, 0.03) 100%);
  border-color: rgba(79, 70, 229, 0.25);
  transform: translateY(-1px); /* Reduced transform for subtle effect */
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.1); /* Reduced shadow */
}

/* Sample Script Button */
.page_sampleScriptButton__bLbxh {
  width: 100%;
  font-size: 0.8rem; /* Slightly smaller font for compact layout */
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #AEAEB5;
  line-height: 1.3; /* Tighter line height */
  padding: 0.3rem 0.5rem; /* Reduced padding for very compact layout */
  background-color: #2A2B32;
  border: 1px solid #3A3B42;
  border-radius: 0.375rem;
  outline: none;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-bottom: 0.125rem; /* Minimal margin for very compact layout */
  text-align: left;
  font-weight: 500;
}

.page_sampleScriptButton__bLbxh:hover {
  background-color: #32333A;
  border-color: #4F46E5;
  color: #ECECEC;
  transform: translateY(-1px);
}

.page_sampleScriptButton__bLbxh:focus {
  border-color: #4F46E5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
  background-color: #32333A;
  color: #ECECEC;
}

.page_sampleScriptButton__bLbxh:active {
  transform: translateY(0);
}

.page_sampleScriptButton__bLbxh:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Specifics for Select (mostly inherited, arrow styling) */
.page_imageSizeSelect__dKWSD {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; 
  background-image: none;
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25em 1.25em;
  padding-right: 2.5rem;
  /* Simple CSS arrow instead of SVG */
  position: relative;
}

.page_imageSizeSelect__dKWSD::after {
  content: '▼';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #ACACBE;
  pointer-events: none;
  font-size: 0.8rem;
}

/* Container for main prompt textarea - no longer needed for visual box */
.page_mainTextareaContainer__jrMIf {
  display: contents; /* Effectively removes it from layout, children are direct */
}

/* Generate Button Styling */
.page_sendButton__gAYQk {
  width: 100%;
  padding: 0.5rem 1rem; /* Further reduced padding for maximum compactness */
  font-size: 1rem; /* Slightly smaller font size */
  font-weight: 600;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #fff;
  background-color: #5558e9; /* A vibrant purple/blue */
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s, opacity 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.page_sendButton__gAYQk:hover:not(:disabled) { background-color: #4338CA; }
.page_sendButton__gAYQk:disabled {
  background-color: #444;
  cursor: not-allowed;
  color: #888;
}

.page_buttonInactive__tYNUB {
  background-color: #333;
  color: #777;
}

/* Generate button section - Give it dedicated space with separator */
.page_generateButtonSection__VQO9u {
  margin-bottom: 1rem; /* Space below the section */
  padding-bottom: 1rem; /* Padding before separator */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Separator line like New Project button */
}

.page_generateButtonFullWidth__y1pEI {
  margin: 0; /* Button takes full width with no extra margin */
}

/* Gold, animated "ready" style for the estimate button. Scoped and
   only applied when not disabled to avoid UI regressions. */
.page_sendButtonReady__h4SoW:not(:disabled) {
  color: #111;
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 60%, #ffe08a 100%);
  box-shadow: 0 6px 16px rgba(251, 191, 36, 0.35), inset 0 -2px 0 rgba(0,0,0,0.1);
  animation: page_goldPulse__YgxgM 2.2s ease-in-out infinite;
}

.page_sendButtonReady__h4SoW:not(:disabled):hover {
  filter: brightness(1.05);
  box-shadow: 0 8px 22px rgba(251, 191, 36, 0.45), inset 0 -2px 0 rgba(0,0,0,0.12);
}

.page_sendButtonReady__h4SoW:not(:disabled):active {
  transform: translateY(0.5px);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3), inset 0 -1px 0 rgba(0,0,0,0.12);
}

@keyframes page_goldPulse__YgxgM {
  0%, 100% {
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.35), inset 0 -2px 0 rgba(0,0,0,0.1);
    filter: saturate(1);
  }
  50% {
    box-shadow: 0 10px 26px rgba(251, 191, 36, 0.5), inset 0 -2px 0 rgba(0,0,0,0.1);
    filter: saturate(1.08);
  }
}

/* Advanced options toggle and container */
.page_advancedOptionsToggle__8KTjY {
  background: none;
  border: none;
  color: #AEAEB5;
  cursor: pointer;
  padding: 0.4rem 0;
  font-size: 0.875rem;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  width: 100%;
  text-align: left;
  margin-top: 0.125rem; /* Reduced margin for more compact layout */
  margin-bottom: 0.25rem; /* Reduced margin for more compact layout */
  border-top: 1px solid #40414F;
  border-bottom: 1px solid #40414F;
}

.page_advancedOptionsToggle__8KTjY:hover {
  color: #ECECEC;
}

.page_advancedOptionsContainer__d_QmF {
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, visibility 0.3s ease-in-out;
  max-height: 0;
  visibility: hidden;
}

.page_advancedOptionsContainerVisible__YV1l4 {
  max-height: 500px; /* Adjust as needed to fit content */
  visibility: visible;
  padding-top: 0.125rem; /* Reduced padding for more compact layout */
}

/* Add more spacing for advanced options */
.page_advancedOptionsContainer__d_QmF .page_formGroup__7oW5j {
  margin-bottom: 0.5rem; /* Reduced margin for more compact layout */
}

/* Output Section */
.page_outputSection__sfEXh {
  flex-grow: 1; /* Occupy remaining horizontal space */
  height: 100%; /* Fill height of mainContent */
  padding: 0 2rem 1.5rem 2rem; /* Adjust padding for sticky header */
  box-sizing: border-box;
  overflow-y: auto; /* Allow results to scroll */
  display: flex;
  flex-direction: column;
}

/* Old .inputSection is removed */
.page_inputSection__R2gtA {
  display: none;
}

.page_welcomeArea__Awf6h { /* For messages in outputSection */
  flex-grow: 1; 
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #DADADA;
  padding: 2rem; /* More padding if it's the main view */
}

.page_welcomeTitle__UiIjI {
  font-size: 2rem;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
}

.page_welcomeSubtitle__Umar7 {
  font-size: 1rem;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #A0A0B0;
  max-width: 600px; /* Max width for subtitle text */
  margin-top: 0.5rem;
  line-height: 1.6;
}

.page_magicEmoji__lU5Wb {
  display: inline-block;
  margin-left: 0.25rem;
}

.page_guideLink__ihtUU {
  color: #10b981; /* Emerald green to match generate button theme */
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 1px solid transparent;
}

.page_guideLink__ihtUU:hover {
  color: #34d399; /* Lighter green on hover */
  border-bottom-color: #34d399;
}

.page_loadingAreaFullscreen__G9lr2 { 
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.page_loadingText__7zsfU {
  font-size: 1.125rem;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #AEAEB5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.page_loadingSubtext__uHcXB {
  font-size: 0.9rem;
  color: #8E8EA0;
  margin-top: 1rem;
}

@keyframes page_spinner-spin__4VMXT {
  to {
    transform: rotate(360deg);
  }
}

.page_spinner__ZsdZL {
  display: inline-block;
  width: 2.5rem; /* Slightly larger */
  height: 2.5rem; /* Slightly larger */
  vertical-align: text-bottom;
  border: 0.25em solid #4A4A4A; /* A bit more subtle border color */
  border-right-color: #ECECEC; /* Highlight color */
  border-radius: 50%;
  animation: page_spinner-spin__4VMXT .75s linear infinite;
  margin-bottom: 1.5rem; /* More space */
}

.page_srOnly__CoSkI {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.page_resultsErrorArea__6j8aQ { /* For full-section errors in outputSection */
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page_resultsErrorInline__imDAF {
  /* For errors shown above results, within resultsContainer */
  padding: 0.75rem;
  margin-bottom: 1rem;
  /* Uses .error base style from JSX */
}

/* Insufficient credits callout */
.page_creditsCallout__qsIyw {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border: 2px solid rgba(79,70,229,0.45);
  background: linear-gradient(90deg, rgba(79,70,229,0.10), rgba(79,70,229,0.04));
  border-radius: 12px;
}
.page_creditsCalloutLeft__w7Y8F { display: flex; align-items: center; gap: 0.75rem; }
.page_creditsCalloutIcon__lI0Rs { font-size: 1.25rem; }
.page_creditsCalloutContent__xlcmm {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.page_creditsCalloutTitle__DQkTz {
  font-weight: 600;
}
.page_creditsCalloutBody__6tOO2 {
  color: #4b5563;
}
.page_creditsCalloutActions__cuLJm {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.page_primaryCta__ovcnu {
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-weight: 600;
}
.page_primaryCta__ovcnu:disabled {
  opacity: 0.7;
  cursor: default;
}
.page_secondaryLink__ScI7_ {
  color: #4f46e5;
  text-decoration: underline;
}

.page_uniformGridContainer__H0uF4 {
  width: 100%;
  padding-top: 1rem;
}

.page_generationNotification__yuDne {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  border: 1px solid #6D28D9;
  color: #FFFFFF;
  border-radius: 0.75rem;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.page_chunkSection__yWaAZ {
  margin-bottom: 3rem; /* Space between each chunk's section */
}

.page_chunkHeader__hMpTI {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.25rem;
  background-color: #202123; /* Darker header background */
  border: 1px solid #40414F;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
}

.page_fullPageError__SA4ci {
}

/* Remove styles for .chatInputForm as it's renamed to .imageGenerationForm and restyled */
/* .chatInputForm { ... } */

/* Comment out or remove .container if .chatGptContainer is the main one */
/* .container { display: none; } */

/* Remove or comment out old .form, .formLabel, .textarea, .select, .button if they are fully replaced */
.page_form__GSC3Z, .page_textarea__x1qFz, .page_select___dv3Y, .page_button__kdKFB {
  /* display: none; */
}

.page_charCount__DMPBk {
  font-size: 0.8rem;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #666;
  text-align: right;
  margin-top: 4px;
  padding-right: 8px;
}

/* Add warning style when approaching limit */
.page_charCount__DMPBk[data-approaching-limit="true"] {
  color: #ff6b6b;
}

/* Add error style when at limit */
.page_charCount__DMPBk[data-at-limit="true"] {
  color: #ff0000;
  font-weight: bold;
}

/* NEW: Scrollable container for chunklets */
.page_chunkContentScrollable___PpRz {
  flex-grow: 1;
  overflow-y: auto;
  padding: 0 1.25rem 1.25rem 1.25rem; /* Match side padding */
}

/* Styles for the project delete button in the sidebar */
.page_sidebarItem__kHnHP {
  /* This is being redefined to add flex properties. Ensure this doesn't conflict with existing layout. */
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative; /* Needed for hover effect positioning if any */
}

.page_sidebarItemName__ZTljN {
  flex-grow: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.25rem; /* Add some padding for the hover effect */
  border-radius: 0.25rem;
  display: flex; /* Use flexbox for alignment */
  align-items: center; /* Center icon and text vertically */
  gap: 0.5rem; /* Space between name and icon */
}

.page_deleteProjectButton__Fm3d3 {
  background: none;
  border: none;
  color: #9ca3af; /* A muted gray */
  cursor: pointer;
  display: none; /* Hide by default */
  padding: 0.5rem;
  margin-left: 0.25rem; /* Space between name and button */
  border-radius: 4px;
  line-height: 1; /* Ensures icon is centered vertically */
  flex-shrink: 0; /* Prevent the button from shrinking */
}

/* Show the delete button when hovering over the sidebar item container */
.page_sidebarItem__kHnHP:hover .page_deleteProjectButton__Fm3d3 {
  display: block;
}

.page_deleteProjectButton__Fm3d3:hover {
  background-color: #4b5563; /* A dark gray for hover state */
  color: #f3f4f6; /* Lighter color on hover */
}

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

.page_miniSpinner__Ca_hf {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: page_spin__wygAS 1s ease-in-out infinite;
}

/* Re-using a keyframe animation name is fine, but ensure it's defined if not already present */
@keyframes page_spin__wygAS {
  to { transform: rotate(360deg); }
}

.page_sidebarRenameInput__XqvrL {
  width: 100%;
  background-color: #3a3b42;
  border: 1px solid #4f46e5;
  color: #ececec;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  outline: none;
}

.page_sidebarRenameInput__XqvrL::placeholder {
  font-size: 0.875rem; /* Match input font size */
  font-family: var(--font-geist-sans); /* Consistent font */
  color: #6B7280; /* Consistent color */
  opacity: 1; /* Ensure full opacity across browsers */
}

/* --- New styles for edit indicator --- */
.page_editIcon__ylZMO {
  visibility: hidden; /* Hidden by default */
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  flex-shrink: 0; /* Prevent the icon from shrinking */
  color: #aeb0b4; /* A neutral color */
}

.page_sidebarItem__kHnHP.page_activeProject__RNDxu .page_sidebarItemName__ZTljN:hover .page_editIcon__ylZMO {
  visibility: visible; /* Show on hover of the parent name container */
  opacity: 1;
}

.page_sidebarItem__kHnHP.page_activeProject__RNDxu .page_sidebarItemName__ZTljN:hover {
  background-color: #3A3B3D;
}
/* --- End new styles --- */

/* Credit Cost Display Styles */
.page_creditCostContainer__LlNR0 {
  margin: 1rem 0;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 0.75rem;
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}

.page_creditCostDisplay__yO_lz {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.page_creditCostLabel__J5AQO {
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #ECECEC;
}

.page_creditCostAmount__3mFjC {
  font-size: 1.125rem;
  font-weight: 700;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.page_creditCostAmount__3mFjC.page_insufficientCredits__PM4Um {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.page_creditBalance__VEzAi {
  font-size: 0.8rem;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  color: #AEAEB5;
  font-style: italic;
}

.page_creditWarning__LZrVN {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 0.5rem;
  color: #ef4444;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-geist-sans); /* Ensure consistent font */
  margin-top: 0.5rem;
}

/* Credit warning specific styles */
.page_creditWarning__LZrVN {
  color: #f87171; /* Bright red for warnings */
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 0.5rem;
  text-align: center;
}

/* Confirmation Dialog Styles */
.page_overlay__Jh2mi {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: page_fadeIn___sksj 0.3s ease-out;
}

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

.page_dialog__XdyWt {
  background-color: #2c2c2e;
  color: #f5f5f7;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid #444;
  position: relative;
  animation: page_slideIn__haQHo 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes page_slideIn__haQHo {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.page_title__xXmff {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  color: #fff;
}

.page_subtitle__GcM10 {
  margin-top: 0;
  margin-bottom: 24px;
  font-size: 14px;
  text-align: center;
  color: #aaa;
}

.page_subtitle__GcM10 strong {
  color: #f5f5f7;
  font-weight: 500;
}

.page_costBreakdown__YqwZY {
  margin-bottom: 24px;
  border: 1px solid #444;
  border-radius: 8px;
  overflow: hidden;
}

.page_costItem__XmDvh {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #444;
}

.page_costItem__XmDvh:last-child {
  border-bottom: none;
}

.page_finalBalance__G6uxS {
  background-color: #3a3a3c;
  font-weight: 600;
}

.page_balanceValue__2UGwE {
  color: #10b981;
  font-weight: 600;
}

.page_costValue__XATgX {
  font-weight: 600;
}

.page_costTotal__9zuT1 {
  color: #ef4444;
}

.page_dialogActions__WrIUf {
  display: flex;
  gap: 12px;
}

.page_dialogButton__rpNtd {
  flex: 1 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.page_cancelButton__VmJt8 {
  background-color: #666;
  color: white;
}

.page_cancelButton__VmJt8:hover {
  background-color: #777;
}

.page_confirmButton__qmMhw {
  background-color: #007aff;
  color: white;
}

.page_confirmButton__qmMhw:hover {
  background-color: #0056b3;
}

/* Sidebar toggle button - visible on mobile */
.page_sidebarToggle__wSfz4 {
  display: none; /* Hidden on desktop */
  position: fixed; /* Changed from absolute to fixed so it scrolls with the user */
  top: 50%; /* Vertically centered */
  left: 40px; /* Position relative to collapsed sidebar width (56px) minus half button (16px) */
  transform: translateY(-50%); /* Adjust for perfect centering */
  width: 32px; /* 20% smaller */
  height: 32px; /* 20% smaller */
  background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
  border: 2px solid #343541;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  z-index: 100;
  transition: transform 0.3s ease, box-shadow 0.3s ease, left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  align-items: center;
  justify-content: center;
}

.page_sidebarToggle__wSfz4:hover {
  transform: translateY(-50%) scale(1.1); /* Combine transforms */
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

/* Pulsing animation for new users */
.page_sidebarTogglePulse__jyuRS {
  animation: page_pulseAttention__rihn2 2s infinite;
}

@keyframes page_pulseAttention__rihn2 {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 6px 24px rgba(79, 70, 229, 0.8);
  }
}

/* Tooltip for sidebar toggle - keeps absolute positioning relative to button */
.page_sidebarToggle__wSfz4::before {
  content: 'View Projects';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 8px;
  background: #202123;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.page_sidebarTogglePulse__jyuRS::before {
  opacity: 1;
}

.page_toggleIcon__WNYoy {
  transition: transform 0.3s ease;
}

/* Removed rotation so the icon direction is controlled by React state path */
/* .sidebarOpen .toggleIcon { transform: rotate(180deg); } */

/* Removed projectCount bubble for a cleaner look on mobile */

/* Mobile responsive styles start here */
@media (max-width: 768px) {
  .page_creditCostDisplay__yO_lz {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .page_creditCostContainer__LlNR0 {
    padding: 0.75rem;
    margin: 0.75rem 0;
  }

  /* Hide input panel when viewing a loaded project on mobile */
  .page_inputPanel__MFxII {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #40414F;
  }

  /* Hide input panel completely when there's an active project */
  .page_chatGptContainer__rU1RH:has(.page_resultsContainer__b6Mgb) .page_inputPanel__MFxII {
    display: none;
  }

  /* RESULTS HEADER - now just for the title, remains sticky */
  .page_resultsHeader__kraiX {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
    padding: 0.5rem 0.75rem; /* tighter */
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    background-color: #343541;
    z-index: 10;
    border-bottom: 1px solid #40414F;
  }

  .page_resultsTitle__4kwr_ {
    font-size: 1.1rem;
    text-align: center;
  }

  /* ACTION BUTTONS - now a sticky footer */
  .page_resultsActions__YMaHN {
  position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    flex-direction: row;
    gap: 0.25rem;
    padding: 0.5rem 0.25rem;
    background: rgba(42, 43, 50, 0.9);
    -webkit-backdrop-filter: blur(5px);
            backdrop-filter: blur(5px);
    border-top: 1px solid #4A4A4A;
    z-index: 20;
    box-sizing: border-box;
  }

  /* Make footer wrap cleanly on small screens */
  .page_resultsActions__YMaHN {
    flex-wrap: wrap;
  }

  /* Stack voice controls and expand the primary action */
  .page_voiceAndGenerateGroup__bMmkf {
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    order: 0;
  }

  /* Hide verbose voice selector UI on mobile to avoid footer crowding */
  .page_voiceSelectorGroup__iGnrH {
    display: none;
  }

  /* Primary CTA should span full width */
  .page_generateVideoButton__kSxFl {
    width: 100%;
    justify-content: center;
  }

  .page_unselectButton__tpSJI,
  .page_downloadButton__Nf2VF {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: calc(50% - 0.25rem);
    justify-content: center;
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
    height: 40px;
  display: flex;
  align-items: center;
    white-space: nowrap;
    order: 1;
  }

  .page_unselectButton__tpSJI svg,
  .page_downloadButton__Nf2VF svg {
    width: 14px;
    height: 14px;
    margin-right: 0.25rem;
}

  .page_outputSection__sfEXh {
    flex: 1 1;
    overflow-y: auto;
    /* Leave space for two-row sticky footer on mobile */
    padding-bottom: 110px; 
  }

  /* Additional padding when timeline is visible on mobile */
  .page_mainContent__CS_Du.page_withTimeline__XSNMR .page_outputSection__sfEXh {
    padding-bottom: 220px;
  }

  /* Fix image grid layout for mobile */
  .page_uniformGridContainer__H0uF4 {
    padding: 1rem;
}

  .page_chunkSection__yWaAZ {
    margin-bottom: 2rem;
  }

  .page_chunkHeader__hMpTI {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .page_chunkletsContainer__TBqzs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem 1rem 1rem;
    align-items: center;
}

  .page_chunkletCard__RLHIv {
    aspect-ratio: auto; /* Let card height adjust to image */
    max-width: 100%;
  }

  .page_chunkletImage___tp7e {
    height: auto;
  }

  /* Stack input panel above results on mobile */
  .page_mainContent__CS_Du {
    margin-left: 0; /* Remove desktop sidebar margin */
    flex-direction: column;
    height: auto;
  }

  /* Allow overall page to scroll when content exceeds viewport */
  .page_chatGptContainer__rU1RH {
    height: auto;
    overflow-y: auto;
}

  /* Show toggle button on mobile */
  .page_sidebarToggle__wSfz4 {
    display: flex !important;
  }

  /* Expandable sidebar with better visibility */
  .page_sidebar__zU6ul {
    position: relative !important;
    width: 56px; /* Slimmer rail for compact mode */
    min-height: calc(100vh - 60px);
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible; /* Allow toggle button to stick out */
    background: linear-gradient(180deg, #202123 0%, #1a1a1d 100%);
    top: auto;
    left: auto;
    height: auto;
    border-right: 2px solid #4F46E5; /* Colorful border to draw attention */
    box-shadow: 2px 0 8px rgba(79, 70, 229, 0.2);
  }

  .page_sidebarOpen__tLHNZ {
    width: 240px; /* Slightly narrower expanded width */
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.3);
  }

  /* Adjust toggle button position when sidebar is expanded */
  .page_sidebarOpen__tLHNZ .page_sidebarToggle__wSfz4 {
    left: 224px; /* Position relative to expanded sidebar width (240px) minus half button (16px) */
  }

  /* Collapsed sidebar styles */
  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) {
    cursor: default; /* Remove cursor pointer from entire sidebar */
  }

  /* Keep header visible but compact in collapsed state */
  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_sidebarHeader__2rMjc {
    padding: 0.5rem;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_newChatButton__4JxYx {
    width: 44px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    margin: 0 auto 0.5rem;
    font-size: 0.75rem;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_newChatButton__4JxYx span {
    display: none;
  }

  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_newChatButton__4JxYx svg {
    width: 20px;
    height: 20px;
  }

  /* Keep nav visible in collapsed state */
  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_sidebarNav__5jic1 {
    opacity: 1 !important;
    visibility: visible !important;
    padding: 0 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center; /* center chips between rail edges */
  }

  /* Hide section titles in collapsed state */
  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_sidebarSectionTitle__ThdC_ {
    display: none;
  }

  /* Show project previews in collapsed state */
  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_sidebarItem__kHnHP {
    width: 44px;
    height: 44px;
    margin: 0.35rem 0; /* visually center between separator line and rail edge */
    border-radius: 10px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    overflow: hidden;
    background: #2A2B32;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    position: relative;
    cursor: pointer; /* clickable */
  }

  /* Show project initials using data attribute */
  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_sidebarItem__kHnHP::before {
    content: attr(data-project-initial);
    font-size: 0.78rem;
    font-weight: 700;
    color: #ECECEC;
  }

  /* Active project highlight in collapsed state */
  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_sidebarItem__kHnHP.page_activeProject__RNDxu {
    background: #4F46E5;
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
  }
  
  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_sidebarItem__kHnHP:hover {
    background-color: #3A3B42;
    transform: scale(1.05);
  }

  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_sidebarItem__kHnHP.page_activeProject__RNDxu::before {
    color: white;
  }

  /* Generating project animation in collapsed state */
  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_sidebarItem__kHnHP.page_generatingProject__6OF1B {
    border-color: #4F46E5;
    animation: page_pulseGlow__TZqMO 2s infinite;
  }

  @keyframes page_pulseGlow__TZqMO {
    0%, 100% { box-shadow: 0 0 4px rgba(79, 70, 229, 0.4); }
    50% { box-shadow: 0 0 12px rgba(79, 70, 229, 0.8); }
  }

  /* Hide project names and controls in collapsed state */
  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_sidebarItemName__ZTljN,
  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_deleteProjectButton__Fm3d3,
  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_editIcon__ylZMO {
    display: none !important;
  }

  /* Remove the old visual indicator */
  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ)::after {
    display: none;
  }

  /* Empty state in collapsed sidebar */
  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_sidebarEmptyState__ROgMQ {
    width: 44px;
    height: 44px;
    margin: 1rem auto;
    padding: 0;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #2A2B32;
    border-radius: 8px;
    border: 2px dashed #40414F;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_sidebarEmptyIcon__XEEXg {
    font-size: 1.5rem;
    margin: 0;
  }

  .page_sidebar__zU6ul:not(.page_sidebarOpen__tLHNZ) .page_sidebarEmptyText__jrpPI {
    display: none;
  }

  /* Stack input panel above results on mobile */
  .page_mainContent__CS_Du {
    flex-direction: column;
    height: auto;
    margin-left: 0; /* reclaim full width; let flex layout handle sidebar width */
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* When sidebar is open, no extra margin needed */
  .page_chatGptContainer__rU1RH:has(.page_sidebarOpen__tLHNZ) .page_mainContent__CS_Du {
    margin-left: 0;
  }

  .page_chatGptContainer__rU1RH {
    height: auto;
    overflow-y: auto;
  }

  .page_inputPanel__MFxII {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #40414F;
  }

  .page_outputSection__sfEXh {
    flex: 1 1;
    overflow-y: auto;
    padding-left: 0.75rem; /* reclaim some middle space */
    padding-right: 0.75rem;
  }
} 

/* ------------------- */
/* --- MEDIA QUERIES --- */
/* ------------------- */
@media (max-width: 1200px) {
  .page_mainContent__CS_Du {
    flex-direction: column;
  }
  .page_inputPanel__MFxII {
    width: 100%;
    max-width: none;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .page_outputSection__sfEXh {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .page_resultsHeader__kraiX {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .page_resultsActions__YMaHN {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .page_downloadButton__Nf2VF, .page_unselectButton__tpSJI, .page_generateVideoButton__kSxFl {
    width: 100%;
    justify-content: center;
  }
} 

/* --- Project Videos Section --- */
.page_projectVideosSection__Mz8PP {
  padding: 1rem 1.5rem;
  background-color: #2a2a2e;
  border-radius: 8px;
  margin: 0 1.5rem 1.5rem 1.5rem;
  border: 1px solid #3a3a3e;
}

.page_projectVideosTitle__N9vmu {
  font-size: 1rem;
  font-weight: 600;
  color: #e5e5e6;
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #3a3a3e;
}

.page_projectVideosList__e1KKe {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page_projectVideoLink__fAGmD {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #3a3a3e;
  color: #e5e5e6;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.page_projectVideoLink__fAGmD:hover {
  background-color: #4a4a4e;
}
/* VideoStoryboard.module.css */

.VideoStoryboard_storyboardContainer__PrTUK {
  padding: 1.5rem; /* Restore padding */
  background-color: #1e1e1e; /* Darker background for contrast */
  border-radius: 8px;
  color: #e0e0e0;
  /* Accent used for any duration-related UI to visually link them */
  --duration-accent: #00e5ff;
  --duration-accent-bg: rgba(0, 229, 255, 0.12);
  --duration-accent-border: rgba(0, 229, 255, 0.35);
}

.VideoStoryboard_headerActions__iuJzL {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.VideoStoryboard_durationInfo__Mr0T3 {
  font-size: 0.9rem;
  color: #b0b0b0;
}

.VideoStoryboard_durationInfo__Mr0T3 strong {
  color: #fff;
  font-weight: 600;
}

.VideoStoryboard_generateVideoButton__PUgtl {
  background-color: #4A90E2; /* A nice blue */
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.VideoStoryboard_generateVideoButton__PUgtl:hover:not(:disabled) {
  background-color: #5aa1f2;
  transform: translateY(-1px);
}

.VideoStoryboard_generateVideoButton__PUgtl:disabled {
  background-color: #555;
  cursor: not-allowed;
  opacity: 0.7;
}


/* Scene Styles */
.VideoStoryboard_scene__DyN2Q {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #2a2a2a;
  border-radius: 8px;
  border: 1px solid #383838;
}

.VideoStoryboard_sceneText__qBu9Y {
  flex: 1 1;
  min-width: 200px;
}

.VideoStoryboard_sceneHeader__XZyGm {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #444;
}

.VideoStoryboard_sceneNumber__5HDdp {
  font-weight: 600;
  color: #fff;
  font-size: 1rem;
}

.VideoStoryboard_sceneDuration__YJw4Q {
  font-size: 0.85rem;
  color: var(--duration-accent);
  background-color: var(--duration-accent-bg);
  border: 1px solid var(--duration-accent-border);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

/* Generate More Images button for each scene */
.VideoStoryboard_generateMoreImagesButton__qfM3g {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #e5e7eb;
  background-color: #4a4a4a;
  border: 1px solid #5a5a5a;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.VideoStoryboard_generateMoreImagesButton__qfM3g:hover:not(:disabled) {
  background-color: #5a5a5a;
  border-color: #6a6a6a;
  transform: translateY(-1px);
}

.VideoStoryboard_generateMoreImagesButton__qfM3g:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.VideoStoryboard_sceneText__qBu9Y p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #ccc;
  margin: 0;
}

/* Override panel styles */
.VideoStoryboard_overrideContainer__sWERP {
  margin-top: 0.6rem;
  padding: 0.75rem;
  background-color: #232323;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
}

.VideoStoryboard_overrideLabel__NBemS {
  display: block;
  font-size: 0.85rem;
  color: #e0e0e0;
  margin-bottom: 0.3rem;
}

.VideoStoryboard_overrideOptional__MODoy {
  color: #9aa0a6;
}

.VideoStoryboard_overrideInput__w7Yz4 {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #444;
  background-color: #1b1b1b;
  color: #e5e7eb;
}

.VideoStoryboard_overrideHelp__nbOjI {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #a0a0a0;
}

.VideoStoryboard_overrideActions__juEgv {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.5rem;
}

.VideoStoryboard_overrideConfirmButton__yL7I2 {
  background-color: #4A90E2;
  color: white;
  border: 1px solid #4A90E2;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.VideoStoryboard_overrideUseOriginalButton__WpUS_ {
  background-color: #3a3a3a;
  color: #e5e7eb;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.VideoStoryboard_overrideCancelButton__sz6zB {
  background: transparent;
  color: #a0a0a0;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Image Selector Styles */
.VideoStoryboard_sceneImageSelector__WPGx_ {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  flex: 2 1;
}

.VideoStoryboard_imageWrapper__QlFJ9 {
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
  width: 150px;
}

.VideoStoryboard_downloadCheckbox__lOr3D {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  z-index: 2; /* Above the image */
}

/* --- New Animation Panel Styles --- */

.VideoStoryboard_animateButton__psZ75 {
  padding: 4px 8px;
  width: auto;
  max-width: 80px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(74, 144, 226, 0.95);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
  position: relative;
  z-index: 5;
}
.VideoStoryboard_animateButton__psZ75:hover {
  background: rgba(85, 155, 235, 1);
  box-shadow: 0 3px 12px rgba(74, 144, 226, 0.6);
  transform: translateY(-1px);
}

.VideoStoryboard_animationPanel___2xia {
  background: rgba(20, 20, 20, 0.9);
  padding: 6px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
}

.VideoStoryboard_modelSelect___bKtY {
  width: 100%;
  padding: 3px 5px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid #444;
  background: #1b1b1b;
  color: #e5e7eb;
}

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

.VideoStoryboard_cancelButton___Mf4G {
  flex: initial;
  padding: 5px 8px;
  font-size: 11px;
  background-color: #3a3a3a;
  border: 1px solid #555;
  color: #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
}

.VideoStoryboard_animationPanelContainer__ZAfS4 {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 6;
  padding: 6px;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 20%, rgba(0,0,0,0.7) 70%, rgba(0,0,0,0) 100%);
  border-radius: 0 0 8px 8px;
}

/* Minimal controls for creating and listing video clips per image */
.VideoStoryboard_clipControls__gSavs {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 3;
  align-items: flex-end;
}

.VideoStoryboard_clipRow__qA1Eq {
  display: flex;
  gap: 6px;
}

.VideoStoryboard_clipPromptInput__eJqiX {
  flex: 1 1;
  min-width: 0;
  padding: 3px 5px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid #444;
  background: rgba(20,20,20,0.8);
  color: #e5e7eb;
}

.VideoStoryboard_clipButton__1i_qb {
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 700;
  background: #4A90E2;
  color: #fff;
  border: 1px solid #4A90E2;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.35);
  width: 100%;
}

.VideoStoryboard_clipButton__1i_qb:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.VideoStoryboard_clipError__ygcc7 {
  font-size: 10px;
  color: #ff8080;
  line-height: 1.3;
}

.VideoStoryboard_clipList__9w_5C {
  display: flex;
  gap: 6px;
}

.VideoStoryboard_clipLink__jqqYA {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(0,0,0,0.5);
  color: #e5e7eb;
  text-decoration: none;
}

.VideoStoryboard_imageWrapper__QlFJ9:hover {
  transform: scale(1.05);
  border-color: #777;
}

.VideoStoryboard_imageWrapper__QlFJ9.VideoStoryboard_selected__cdQFF {
  border-color: #4A90E2;
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
}

.VideoStoryboard_thumbnailImage__aKaVI {
  object-fit: cover;
}

/* Aspect-ratio-aware skeleton placeholder with shimmer */
.VideoStoryboard_skeleton__ybQgA {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(90deg, #2a2a2a 25%, #333 37%, #2a2a2a 63%);
  background-size: 400% 100%;
  animation: VideoStoryboard_shimmer__DuJqb 1.2s ease-in-out infinite;
}

@keyframes VideoStoryboard_shimmer__DuJqb {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* State-specific styles */
.VideoStoryboard_pendingState__8WBAJ,
.VideoStoryboard_processingState__0QNtA,
.VideoStoryboard_failedState__1aGbJ {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  text-align: center;
}

/* Pending state - waiting to process */
.VideoStoryboard_pendingState__8WBAJ {
  background-color: #1e1e1e;
  border: 2px solid #444;
}

.VideoStoryboard_pendingSpinner__APWOf {
  width: 32px;
  height: 32px;
  border: 3px solid #333;
  border-top-color: #666;
  border-radius: 50%;
  animation: VideoStoryboard_pendingSpin__TC8Y1 1.5s linear infinite;
  margin-bottom: 0.5rem;
}

@keyframes VideoStoryboard_pendingSpin__TC8Y1 {
  to { transform: rotate(360deg); }
}

/* Processing state - actively generating */
.VideoStoryboard_processingState__0QNtA {
  background-color: #1a2332;
  border: 2px solid #4A90E2;
}

.VideoStoryboard_processingSpinner__8GTzL {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(74, 144, 226, 0.2);
  border-top-color: #4A90E2;
  border-radius: 50%;
  animation: VideoStoryboard_processingSpin__wknYm 0.8s linear infinite;
  margin-bottom: 0.5rem;
}

@keyframes VideoStoryboard_processingSpin__wknYm {
  to { transform: rotate(360deg); }
}

/* Failed state */
.VideoStoryboard_failedState__1aGbJ {
  background-color: #2a1a1a;
  border: 2px solid #cc4444;
}

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

.VideoStoryboard_inlineBuyButton__4SvL4 {
  margin-top: 4px;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10px;
  cursor: pointer;
}

.VideoStoryboard_failedIcon__tw4uy {
  font-size: 2rem;
  color: #cc4444;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.VideoStoryboard_failedText__NqVS9 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ff6666;
  margin-bottom: 0.25rem;
}

.VideoStoryboard_failureReason__pULO9 {
  font-size: 0.75rem;
  color: #ff9999;
  line-height: 1.2;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}

.VideoStoryboard_stateText__RXAXg {
  font-size: 0.85rem;
  color: #b0b0b0;
  font-weight: 500;
}

/* Update wrapper states */
.VideoStoryboard_imageWrapper__QlFJ9.VideoStoryboard_pending__i15KP {
  border-color: #444;
}

.VideoStoryboard_imageWrapper__QlFJ9.VideoStoryboard_processing__z88Vb {
  border-color: #4A90E2;
  animation: VideoStoryboard_processingPulse__9xB1m 2s ease-in-out infinite;
}

@keyframes VideoStoryboard_processingPulse__9xB1m {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 144, 226, 0); }
  50% { box-shadow: 0 0 10px 2px rgba(74, 144, 226, 0.4); }
}

.VideoStoryboard_imageWrapper__QlFJ9.VideoStoryboard_failed__1Hmzu {
  border-color: #cc4444;
  cursor: not-allowed;
}

.VideoStoryboard_imageWrapper__QlFJ9.VideoStoryboard_failed__1Hmzu:hover {
  transform: none;
  border-color: #cc4444;
}

/* Disabled wrapper for non-interactive placeholders */
.VideoStoryboard_imageWrapper__QlFJ9.VideoStoryboard_disabled___zHT2 {
  cursor: default;
}
.VideoStoryboard_imageWrapper__QlFJ9.VideoStoryboard_disabled___zHT2:hover {
  transform: none;
  border-color: transparent;
}

/* --- New Video Clip Gallery Styles --- */

.VideoStoryboard_sceneVideoSelector__80twZ {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px solid #383838;
}

.VideoStoryboard_videoWrapper__Ev3og {
  position: relative;
  cursor: pointer;
  border: 2px solid #00e5ff; /* Bright cyan border for videos - highly visible */
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  width: 150px;
  background-color: #1e1e1e;
  /* Maintain aspect ratio */
  aspect-ratio: 1 / 1;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6); /* Bright cyan aura */
}

.VideoStoryboard_videoWrapper__Ev3og:hover {
  transform: scale(1.05);
  border-color: #40f4ff;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.8);
}

.VideoStoryboard_videoWrapper__Ev3og.VideoStoryboard_selected__cdQFF {
  border-color: #00fff7; /* Brighter cyan for selected videos */
  box-shadow: 0 0 20px rgba(0, 255, 247, 0.9);
}

/* Status overlay for video clips */
.VideoStoryboard_videoStatusOverlay__LgYfi {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

.VideoStoryboard_videoStatusText__A1uJs {
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.VideoStoryboard_videoStatusSpinner__N3Z_P {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top: 2px solid #6c5ce7;
  border-radius: 50%;
  animation: VideoStoryboard_spin__enAZH 1s linear infinite;
}

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

.VideoStoryboard_videoStatusError__EXjDm {
  color: #ff6b6b;
  font-size: 11px;
  text-align: center;
  padding: 0 8px;
  margin-top: 6px;
}

.VideoStoryboard_noChargeDisclaimer__ph_Vh {
  color: #78ff78;
  font-size: 9px;
  text-align: center;
  margin-top: 4px;
  font-weight: 500;
  opacity: 0.8;
}

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

/* Video info overlay */
.VideoStoryboard_videoInfoOverlay__XTfNE {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 3px;
  padding: 2px 4px;
  z-index: 5;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}

.VideoStoryboard_videoInfo__nYCY4 {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: flex-end;
}

.VideoStoryboard_videoModel__kVcJv {
  font-size: 8px;
  font-weight: 600;
  color: #e0e0e0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1;
}

.VideoStoryboard_videoDuration__FgWWQ {
  font-size: 7px;
  color: var(--duration-accent);
  font-weight: 600;
  line-height: 1;
}

@media (max-width: 768px) {
    .VideoStoryboard_scene__DyN2Q {
        flex-direction: column;
    }

    .VideoStoryboard_sceneImageSelector__WPGx_ {
        justify-content: center; /* Center images on mobile */
    }

    .VideoStoryboard_imageWrapper__QlFJ9,
    .VideoStoryboard_videoWrapper__Ev3og {
        width: 120px;
    }
}

.ProjectVideos_projectVideosSection__9T4Mq {
  padding: 1rem 1.5rem;
  background-color: #1e1e22; /* Slightly different background to stand out */
  border-radius: 8px;
  margin: 0 1.5rem 1.5rem 1.5rem;
  border: 1px solid #3a3a3e;
}

.ProjectVideos_projectVideosTitle__LrnS_ {
  font-size: 1rem;
  font-weight: 600;
  color: #e5e5e6;
  margin: 0 0 1rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid #3a3a3e;
}

.ProjectVideos_carouselContainer__a5qez {
  display: flex;
  overflow-x: auto;
  gap: 1.5rem;
  padding-bottom: 1rem; /* For scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #4a4a4e #2a2a2e;
}

/* Custom scrollbar for Webkit browsers */
.ProjectVideos_carouselContainer__a5qez::-webkit-scrollbar {
  height: 8px;
}
.ProjectVideos_carouselContainer__a5qez::-webkit-scrollbar-track {
  background: #2a2a2e;
  border-radius: 4px;
}
.ProjectVideos_carouselContainer__a5qez::-webkit-scrollbar-thumb {
  background-color: #4a4a4e;
  border-radius: 4px;
  border: 2px solid #2a2a2e;
}
.ProjectVideos_carouselContainer__a5qez::-webkit-scrollbar-thumb:hover {
  background-color: #5a5a5e;
}

.ProjectVideos_videoItem__GVWRP {
  position: relative;
  flex: 0 0 200px; /* Fixed width for each thumbnail */
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #111;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
}

.ProjectVideos_videoItem__GVWRP:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

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

.ProjectVideos_videoOverlay__nRpFz {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.ProjectVideos_videoOverlay__nRpFz.ProjectVideos_visible__pegmU {
  opacity: 1;
}

.ProjectVideos_videoActions__YtcuO {
  display: flex;
  gap: 1rem;
}

.ProjectVideos_actionButton__kCen_ {
  background: rgba(30, 30, 34, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
  padding: 0; /* Reset padding */
  text-decoration: none; /* For <a> tags */
}

.ProjectVideos_actionButton__kCen_:hover {
  background-color: #4CAF50;
  transform: scale(1.1);
}

.ProjectVideos_videoLabel__Yfe96 {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.75rem 0.5rem 0.25rem;
  text-align: right;
  box-sizing: border-box;
}

/* --- Responsive Design for Mobile --- */
@media (max-width: 768px) {
  .ProjectVideos_projectVideosSection__9T4Mq {
    margin: 0 0 1rem 0; /* Full width on mobile */
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .ProjectVideos_carouselContainer__a5qez {
    position: relative;
    padding: 0 1rem; /* Add padding for content */
    gap: 1rem;
    /* Hide scrollbar visually but keep it functional */
    scrollbar-width: none; /* For Firefox */
  }
  
  .ProjectVideos_carouselContainer__a5qez::-webkit-scrollbar {
    display: none; /* For Webkit browsers */
  }

  /* Add a fade-out effect to indicate more content */
  .ProjectVideos_carouselContainer__a5qez::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    background: linear-gradient(to right, rgba(30, 30, 34, 0), #1e1e22);
    pointer-events: none; /* Allows clicking through the gradient */
    transition: opacity 0.3s;
  }

  /* Hide the fade-out when scrolled to the end */
  .ProjectVideos_carouselContainer__a5qez.ProjectVideos_scrolled-to-end__WXDkT::after {
    opacity: 0;
  }
  
  .ProjectVideos_videoItem__GVWRP {
    flex: 0 0 180px; /* Slightly smaller thumbnails for mobile */
    height: 100px;
  }
}

