.sitebuilder-page .card-panel {
  border: 1px solid rgba(43, 45, 58, 0.08);
}

/* Bootstrap pagination provides the chip styling now; only layout remains. */
.sitebuilder-progress {
  min-height: 56px;
}







/* Retired: this was a hand-rolled callout with hardcoded orange rgba() and
   near-white text, which is exactly the unreadable banner on a white page.
   Bootstrap's .alert does the same job natively and inherits the theme. */



#start-from-scratch {
  margin-left: 12px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 16px 0 24px;
}

.template-card {
  border: 1px solid var(--vm-line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.template-card:hover {
  transform: translateY(-2px);
  border-color: #ff7043;
}

.template-card.selected {
  border-color: var(--vm-accent);
  box-shadow: 0 0 0 2px rgba(122, 106, 232, 0.3);
}

.template-snapshot {
  height: 130px;
  position: relative;
  overflow: hidden;
}

.template-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(43, 45, 58, 0.7), rgba(43, 45, 58, 0.08));
  display: flex;
  align-items: flex-end;
  padding: 10px;
  font-weight: 600;
  color: var(--vm-ink);
}

.snapshot-bootstrap {
  background: linear-gradient(135deg, #3a7bd5, #3a6073);
}

.snapshot-materialize {
  background: linear-gradient(135deg, #ff9966, #ff5e62);
}

.snapshot-minimal {
  background: linear-gradient(135deg, #ffffff, #ffffff);
}

.template-meta {
  padding: 10px;
  font-size: 0.95rem;
}

.assist-btn {
  margin-top: 4px;
}

.assist-bulk-row {
  margin: 10px 0 6px;
}

.assist-btn-row {
  margin-top: 4px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.assist-btn-row .btn-small {
  height: 24px;
  line-height: 24px;
  padding: 0 10px;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

.assist-suggest-btn {
  display: none;
}

.assist-target-label {
  width: 100%;
  margin: 0 0 3px;
  font-size: 0.68rem;
  color: #455a64;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.assist-separator {
  border: 0;
  border-top: 1px solid var(--vm-ink);
  margin: 6px 0 12px;
}

.ai-loading-field {
  opacity: 0.75;
}

.assist-status {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #212121;
  font-size: 0.92rem;
  margin: 8px 0 4px;
}

.assist-spinner {
  width: 18px !important;
  height: 18px !important;
}

.assist-helper-global {
  margin: 0 0 14px;
  color: #455a64;
  font-size: 0.85rem;
}

.testimonial-generate-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin: 6px 0 14px;
}

.testimonial-count-field {
  width: 110px;
  min-width: 110px;
}

.testimonial-keywords-field {
  flex: 1;
  min-width: 220px;
}

.testimonials-list {
  margin: 8px 0 14px;
}

.testimonial-entry {
  border: 1px solid var(--vm-ink);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fafbfd;
}

.testimonial-entry .row {
  margin-bottom: 0;
}

.cached-image-summary {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--vm-ink);
  border-radius: 8px;
  background: var(--vm-ink);
}

.ai-image-generate-block {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--vm-ink);
  border-radius: 10px;
  background: #fafbfd;
}

.ai-image-generate-block h6 {
  margin: 0 0 6px;
}

.image-gen-loading {
  position: absolute;
  inset: 0;
  background: rgba(43, 45, 58, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
}

#modal-images .modal-content {
  position: relative;
}

.image-gen-loading-card {
  background: #fff;
  color: #212121;
  border-radius: 12px;
  padding: 18px 20px;
  min-width: 240px;
  text-align: center;
  box-shadow: 0 16px 30px var(--vm-line);
}

.image-gen-loading-card p {
  margin: 12px 0 0;
}

.cached-image-summary h6 {
  margin: 0 0 6px;
  color: #ffffff;
}

.cached-image-summary p {
  margin: 4px 0;
  color: #ffffff !important;
}

.cached-image-summary a {
  color: #1565c0;
  word-break: break-all;
}

.site-preview {
  border: 1px dashed var(--vm-line);
  border-radius: 12px;
  min-height: 220px;
  padding: 18px;
  background: var(--vm-panel);
}

.site-preview-placeholder {
  opacity: 0.8;
}

.image-library-panel {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--vm-line);
}

.page-manager-panel {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--vm-line);
}

.page-manager-heading {
  margin: 12px 0 6px;
  color: var(--vm-ink);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.page-chip-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.page-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(43, 45, 58, 0.04);
  color: var(--vm-muted);
}

.page-chip.hidden {
  background: rgba(43, 45, 58, 0.04);
  color: var(--vm-muted);
}

.page-chip-action {
  color: #81d4fa;
  font-weight: 600;
}

.page-chip-action.disabled {
  color: var(--vm-muted);
}

.image-library-list {
  display: grid;
  gap: 10px;
}

.image-library-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 130px auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--vm-line);
  border-radius: 10px;
  background: rgba(43, 45, 58, 0.04);
}

.image-library-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--vm-line);
  background: #fff;
}

.image-library-url {
  font-size: 0.82rem;
  color: var(--vm-ink);
  word-break: break-all;
}

.image-library-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.image-library-actions .btn-small {
  height: 24px;
  line-height: 24px;
  padding: 0 8px;
}

.testimonial-editor-panel {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--vm-line);
}

.testimonial-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}

.testimonial-job-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  vertical-align: middle;
  background: rgba(100, 116, 139, 0.28);
  color: var(--vm-muted);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.testimonial-job-badge.queued,
.testimonial-job-badge.rendering {
  background: rgba(2, 132, 199, 0.22);
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--vm-ink);
}

.testimonial-job-badge.completed {
  background: rgba(22, 163, 74, 0.2);
  border-color: rgba(74, 222, 128, 0.45);
  color: var(--vm-ink);
}

.testimonial-job-badge.failed {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(248, 113, 113, 0.45);
  color: #ffffff;
}

.testimonial-editor-panel .testimonial-entry {
  background: rgba(43, 45, 58, 0.04);
  border: 1px solid var(--vm-line);
}

.testimonial-editor-panel .testimonial-entry label,
.testimonial-editor-panel .testimonial-entry .helper-text {
  color: var(--vm-muted);
}
/* Values the user typed stay full contrast; only the chrome around them is
   muted. The old rule swept inputs into the same grey with !important. */
.testimonial-editor-panel .testimonial-entry textarea,
.testimonial-editor-panel .testimonial-entry input {
  color: var(--vm-ink);
  background: #fff;
}

.testimonial-editor-panel .input-field textarea.materialize-textarea,
.testimonial-editor-panel .input-field input[type=text] {
  border-bottom: 1px solid rgba(43, 45, 58, 0.35) !important;
}

@media (max-width: 700px) {
  .image-library-item {
    grid-template-columns: 1fr;
  }
  .image-library-thumb {
    width: 100%;
    height: 140px;
  }
}

.rendered-real-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.rendered-loading {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #ffffff;
  border-radius: 8px;
  background: #ffffff;
  color: var(--vm-ink);
  font-weight: 600;
}

.assist-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  margin-right: 6px;
  border-radius: 50%;
  color: #ff8a65;
  background: rgba(255, 112, 67, 0.12);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.assist-icon-btn:hover,
.assist-icon-btn:focus {
  background: rgba(255, 112, 67, 0.26);
  color: #ffab91;
  transform: translateY(-1px);
}

.assist-icon-btn.assist-icon-suggest {
  color: #64b5f6;
  background: rgba(66, 165, 245, 0.12);
}

.assist-icon-btn.assist-icon-suggest:hover,
.assist-icon-btn.assist-icon-suggest:focus {
  background: rgba(66, 165, 245, 0.26);
  color: #90caf9;
}

.assist-icon-btn.disabled,
.assist-icon-btn.disabled:hover {
  opacity: 0.45;
  transform: none;
  pointer-events: none;
}

/* Spins the rewrite arrow while that field is waiting on the model. */
.assist-icon-btn.assist-working svg {
  animation: assist-icon-spin 1.1s linear infinite;
}

@keyframes assist-icon-spin {
  to {
    transform: rotate(360deg);
  }
}

.assist-elapsed {
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
  color: #90caf9;
}

.content-omission-summary {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-left: 3px solid #ff7043;
  border-radius: 4px;
  background: rgba(255, 112, 67, 0.08);
  color: var(--vm-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.content-omission-summary.all-filled {
  border-left-color: #4caf50;
  background: rgba(76, 175, 80, 0.08);
}

.preview-work-panel {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid #ffffff;
  border-radius: 8px;
  background: #ffffff;
  color: var(--vm-ink);
}

.preview-work-heading,
.preview-problem-heading {
  margin: 0 0 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.preview-problem-heading {
  margin-top: 16px;
  color: #ffffff;
}

.preview-work-list,
.preview-problem-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.preview-work-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #ffffff;
}

.preview-work-item:first-child {
  border-top: none;
}

.preview-work-spinner {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border: 2px solid #ffffff;
  border-top-color: #ff7043;
  border-radius: 50%;
  animation: preview-work-spin 0.9s linear infinite;
}

.preview-work-queued .preview-work-spinner {
  animation: none;
  border-top-color: var(--vm-muted);
}

@keyframes preview-work-spin {
  to {
    transform: rotate(360deg);
  }
}

.preview-work-body {
  flex: 1 1 auto;
  min-width: 0;
}

.preview-work-label {
  margin: 0;
  font-weight: 600;
}

.preview-work-detail {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--vm-muted);
}

.preview-work-bar {
  margin-top: 6px;
  height: 4px;
  border-radius: 2px;
  background: #ffffff;
  overflow: hidden;
}

.preview-work-bar span {
  display: block;
  height: 100%;
  background: #ff7043;
  transition: width 0.4s ease;
}

.preview-work-total {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--vm-muted);
}

.preview-problem-item {
  padding: 10px 0;
  border-top: 1px solid #ffffff;
}

.preview-problem-item:first-child {
  border-top: none;
}

.preview-problem-title {
  margin: 0;
  font-weight: 600;
  color: #ffffff;
}

.preview-problem-detail {
  margin: 4px 0 8px;
  font-size: 0.88rem;
  color: var(--vm-muted);
}

.rendered-page-card {
  background: #ffffff;
  border: 1px solid #ffffff;
  border-radius: 12px;
  overflow: hidden;
}

.rendered-page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #ffffff;
}

.rendered-page-head h6 {
  margin: 0;
  color: var(--vm-ink);
}

.rendered-page-head a {
  color: #81d4fa;
  font-size: 0.85rem;
}

.rendered-preview-pill {
  font-size: 0.72rem;
  color: var(--vm-muted);
  border: 1px solid #ffffff;
  border-radius: 999px;
  padding: 2px 8px;
}

.rendered-shot,
.rendered-iframe {
  width: 100%;
  display: block;
  border: 0;
}

.rendered-shot {
  background: #fff;
}

.rendered-mobile-wrap {
  border-top: 1px solid #ffffff;
  padding: 12px;
  background: #ffffff;
}

.rendered-mobile-label {
  margin: 0 0 8px;
  color: #9fb3c8;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rendered-mobile-shot {
  display: block;
  width: min(280px, 100%);
  border-radius: 18px;
  border: 2px solid #ffffff;
  background: #fff;
}

.rendered-mobile-frame {
  width: 300px;
  max-width: 100%;
  height: 540px;
  border: 2px solid #ffffff;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
}

.rendered-mobile-iframe {
  width: 1200px;
  height: 2160px;
  border: 0;
  transform: scale(0.25);
  transform-origin: top left;
  pointer-events: none;
}

.rendered-iframe {
  min-height: 480px;
  background: #fff;
  pointer-events: none;
}

.rendered-empty {
  padding: 24px;
  color: #b0bec5;
}

#modal-site-type .btn-large {
  width: 100%;
  margin-top: 8px;
}

#modal-business-ecommerce .btn-large {
  width: 100%;
  margin-top: 8px;
}

#products-list .row {
  margin-bottom: 4px;
}

#modal-site-type .modal-content,
#modal-social-links .modal-content,
#modal-person-name .modal-content,
#modal-business-category .modal-content,
#modal-business-ecommerce .modal-content,
#modal-images .modal-content,
#modal-template-select .modal-content,
#modal-content-form .modal-content,
#modal-testimonials .modal-content,
#modal-finish .modal-content {
  color: #212121;
}

#modal-site-type h4,
#modal-social-links h4,
#modal-person-name h4,
#modal-business-category h4,
#modal-business-ecommerce h4,
#modal-images h4,
#modal-template-select h4,
#modal-content-form h4,
#modal-testimonials h4,
#modal-finish h4,
#modal-site-type p,
#modal-social-links p,
#modal-person-name p,
#modal-business-category p,
#modal-business-ecommerce p,
#modal-images p,
#modal-template-select p,
#modal-content-form p,
#modal-testimonials p,
#modal-finish p {
  color: #212121;
}

#modal-site-type .input-field input,
#modal-site-type .input-field .select-wrapper input,
#modal-social-links .input-field input,
#modal-person-name .input-field input,
#modal-business-category .input-field input,
#modal-business-category .input-field .select-wrapper input,
#modal-images .input-field input,
#modal-images .input-field .select-wrapper input,
#modal-template-select .input-field .select-wrapper input,
#modal-content-form .input-field input,
#modal-content-form .input-field textarea,
#modal-testimonials .input-field input,
#modal-testimonials .input-field textarea,
#modal-testimonials .input-field .select-wrapper input,
#modal-site-type .input-field label,
#modal-social-links .input-field label,
#modal-person-name .input-field label,
#modal-business-category .input-field label,
#modal-images .input-field label,
#modal-template-select .input-field label,
#modal-content-form .input-field label,
#modal-testimonials .input-field label {
  color: #212121 !important;
}

#modal-images .file-path-wrapper input.file-path {
  color: #212121 !important;
}

#modal-site-type .caret,
#modal-social-links .caret,
#modal-images .caret,
#modal-testimonials .caret {
  fill: #212121 !important;
}

#modal-testimonials .testimonial-entry,
#modal-testimonials .testimonial-generate-row,
#modal-testimonials #testimonials-list,
#modal-testimonials .assist-status {
  color: #212121 !important;
}

#modal-testimonials .testimonial-entry textarea,
#modal-testimonials .testimonial-entry input,
#modal-testimonials #testimonial-keywords,
#modal-testimonials .select-wrapper input.select-dropdown {
  color: #212121 !important;
}

.modal .input-field input[type=text].valid,
.modal .input-field input[type=text]:focus.valid,
.modal .input-field input[type=text].validate.valid,
.modal .input-field input[type=text].validate:focus.valid,
.modal .input-field input[type=text]:focus,
.modal .input-field input[type=text].validate:focus,
.modal .input-field textarea.materialize-textarea.valid,
.modal .input-field textarea.materialize-textarea:focus.valid,
.modal .input-field textarea.materialize-textarea:focus,
.modal .input-field .select-wrapper input.select-dropdown:focus {
  border-bottom: 1px solid var(--vm-accent) !important;
  box-shadow: 0 1px 0 0 var(--vm-accent) !important;
}

.modal .input-field input[type=text]:focus + label,
.modal .input-field input[type=text].valid + label,
.modal .input-field input[type=text]:focus.valid + label,
.modal .input-field textarea.materialize-textarea:focus + label,
.modal .input-field textarea.materialize-textarea.valid + label,
.modal .input-field textarea.materialize-textarea:focus.valid + label {
  color: var(--vm-accent) !important;
}

@media only screen and (max-width: 600px) {
  #start-from-scratch {
    margin-left: 0;
    margin-top: 10px;
  }

  .sitebuilder-page .card-panel {
    padding: 14px;
  }

  

  .template-grid {
    grid-template-columns: 1fr;
  }

  .rendered-real-grid {
    grid-template-columns: 1fr;
  }

  .rendered-page-head {
    flex-wrap: wrap;
  }

  .assist-btn-row {
    gap: 6px;
  }

  .assist-btn-row .btn-small {
    padding: 0 8px;
    font-size: 0.68rem;
  }

  .testimonial-count-field,
  .testimonial-keywords-field {
    width: 100%;
    min-width: 100%;
  }

  #generate-testimonials-btn,
  #add-testimonial-btn,
  #review-next {
    width: 100%;
  }

  #modal-images .file-field .btn,
  #modal-content-form .modal-footer .btn {
    width: 100%;
    margin-left: 0 !important;
    margin-bottom: 8px;
  }
}

.suggestion-choices {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #ffffff;
  border-radius: 8px;
  background: #ffffff;
}

.suggestion-choices-heading {
  margin: 0 0 10px;
  font-weight: 600;
  color: var(--vm-ink);
}

.suggestion-choice {
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #ffffff;
  border-left: 3px solid #ffffff;
  border-radius: 6px;
  background: #ffffff;
}

.suggestion-choice.chosen {
  border-left-color: #ff7043;
  background: rgba(255, 112, 67, 0.08);
}

.suggestion-choice-text {
  color: var(--vm-muted);
  line-height: 1.5;
}

.suggestion-choice-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.suggestion-choice-model {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--vm-muted);
}

.assist-rich-btn {
  height: 24px;
  line-height: 24px;
  padding: 0 10px;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: #b0bec5;
  border: 1px solid rgba(176, 190, 197, 0.35);
  border-radius: 999px;
}

.assist-rich-btn:hover {
  color: var(--vm-ink);
  border-color: rgba(255, 255, 255, 0.6);
}

.ai-image-progress {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--vm-ink);
  border-left: 3px solid #ff7043;
  border-radius: 8px;
  background: #fafbfd;
}

.ai-image-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.ai-image-progress-label {
  font-weight: 600;
  color: #ffffff;
}

.ai-image-progress-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--vm-accent);
}

.ai-image-progress-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 3px;
  background: var(--vm-ink);
  overflow: hidden;
}

.ai-image-progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff7043, var(--vm-accent));
  transition: width 0.5s ease;
}

.ai-image-progress-detail {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: #607d8b;
}

.ai-image-gallery {
  margin: 0 0 16px;
}

.ai-image-gallery-heading {
  margin: 0 0 8px;
  font-weight: 600;
  color: #ffffff;
}

.ai-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.ai-image-tile {
  display: block;
  border: 1px solid var(--vm-ink);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.ai-image-tile:hover {
  transform: translateY(-2px);
  border-color: #ff7043;
}

.ai-image-tile img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
}

.stock-library-block {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--vm-ink);
  border-radius: 10px;
  background: #fafbfd;
}

.stock-library-title {
  margin: 0 0 4px;
  color: #ffffff;
}

.stock-library-intro {
  margin: 0 0 10px;
  font-size: 0.85rem;
  /* Inherited an absolute 24px from a broader rule, which against this 0.85rem
     font is a ratio of ~1.76 and reads as a gap between every line. Unitless so
     it scales with the font rather than being re-broken by the next size change. */
  line-height: 1.45;
  color: #607d8b;
}

.stock-library-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.stock-cat {
  padding: 3px 10px;
  border: 1px solid var(--vm-ink);
  border-radius: 999px;
  font-size: 0.75rem;
  color: #455a64;
  background: #fff;
}

.stock-cat:hover {
  border-color: #ff7043;
  color: var(--vm-accent);
}

.stock-cat.active {
  background: #ff7043;
  border-color: #ff7043;
  color: var(--vm-ink);
}

.stock-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
}

.stock-tile {
  position: relative;
  display: block;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.stock-tile img {
  display: block;
  width: 100%;
  height: 92px;
  object-fit: cover;
}

.stock-tile:hover {
  border-color: #ff7043;
}

.stock-tile.chosen {
  border-color: #43a047;
}

.stock-tile-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--vm-ink);
  background: rgba(43, 45, 58, 0.04);
}

.stock-tile.chosen .stock-tile-badge {
  background: #43a047;
}

.header-image-block {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--vm-ink);
  border-left: 3px solid #ff7043;
  border-radius: 10px;
  background: #fafbfd;
}

.header-image-preview {
  margin: 0 0 10px;
  border: 1px solid var(--vm-ink);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.header-image-preview img {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: cover;
}

.header-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.header-image-effective {
  margin: 4px 0 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--vm-ink);
  font-size: 0.82rem;
  color: #ffffff;
  line-height: 1.5;
}

.header-image-size {
  color: #607d8b;
}

.header-image-hint {
  color: #78909c;
}

.custom-page-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
}

.custom-page-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--vm-line);
  border-radius: 8px;
  background: rgba(43, 45, 58, 0.04);
}

.custom-page-row .meta {
  font-size: 0.8rem;
  color: var(--vm-muted);
}

.block-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 8px;
  align-items: start;
  margin-bottom: 8px;
}

.snapshot-parallax {
  background: linear-gradient(160deg, #ffffff 0%, #ffffff 45%, #ff7043 160%);
}

.parallax-editor {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--vm-ink);
  border-left: 3px solid #ff7043;
  border-radius: 10px;
  background: #fafbfd;
}

.parallax-block-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.parallax-block {
  border: 1px solid var(--vm-ink);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.parallax-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--vm-ink);
}

.parallax-block-type {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #546e7a;
}

.parallax-block-tools a {
  margin-left: 10px;
  color: #607d8b;
  font-size: 1rem;
}

.parallax-block-tools a:hover {
  color: var(--vm-accent);
}

.parallax-block-body {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  align-items: flex-start;
}

.px-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 140px;
}

.px-field.wide {
  flex: 1 1 260px;
}

.px-field span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #78909c;
}

.px-field input,
.px-field select,
.px-field textarea {
  margin: 0 !important;
  height: auto !important;
  border: 1px solid var(--vm-ink) !important;
  border-radius: 6px !important;
  padding: 6px 8px !important;
  box-sizing: border-box;
  background: #fff;
}

.px-thumb {
  width: 74px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--vm-ink);
}

.parallax-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Header pick mode: make it obvious which images are selectable and which one
   is currently the header. */
.ai-image-grid.picking .ai-image-tile,
.stock-tile.picking {
  cursor: pointer;
  outline: 2px dashed rgba(255, 112, 67, 0.55);
  outline-offset: 2px;
}

.ai-image-grid.picking .ai-image-tile:hover,
.stock-tile.picking:hover {
  outline-style: solid;
  outline-color: var(--vm-accent);
}

.ai-image-tile,
.stock-tile {
  position: relative;
}

.ai-image-tile.is-header,
.stock-tile.is-header {
  outline: 3px solid #43a047;
  outline-offset: 1px;
}

.tile-flag {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--vm-ink);
  background: #43a047;
}

.tile-flag.pick {
  background: rgba(122, 106, 232, 0.92);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.preview-toolbar-hint {
  font-size: 0.8rem;
  color: var(--vm-muted);
}

/* ---- Videos step ------------------------------------------------------- */
/* Mirrors the stock image grid, but tiles are 16:9 since that is what clips
   actually are, and a poster frame is the only thing worth showing until the
   user commits to one. */
.video-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.video-tile {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  background: #f7f8fc;
  border: 2px solid transparent;
}
.video-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-tile.chosen {
  border-color: var(--vm-accent);
}
.video-tile-noposter {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ffffff, #ffffff);
}
.video-tile-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 3px;
  background: rgba(43, 45, 58, 0.04);
  color: var(--vm-ink);
}
.video-tile.chosen .video-tile-badge {
  background: var(--vm-accent);
}
.video-tile-meta {
  position: absolute;
  right: 6px;
  top: 6px;
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 3px;
  background: rgba(43, 45, 58, 0.06);
  color: var(--vm-ink);
}
.video-preview {
  width: 100%;
  max-height: 340px;
  background: #000;
  border-radius: 4px;
  margin-bottom: 12px;
}
/* The three overlay selects are browser-default, which Materialize does not
   float a label for; keep them labelled without its JS. */
.video-inline-label {
  display: block;
  font-size: 12px;
  color: #9e9e9e;
  margin-top: 4px;
}
.video-overlay-row {
  margin-bottom: 0;
}

/* ---- Product image mock-up ---------------------------------------------- */
/* The stage is position:relative so the click marker can sit on it in the
   same coordinate space the click was measured in. */
.product-image-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin-bottom: 14px;
  line-height: 0;
}
.product-image-stage img {
  max-width: 100%;
  max-height: 340px;
  border-radius: 4px;
  cursor: crosshair;
  display: block;
}
/* Translated by -50% so the marker centres on the click, matching where the
   text will actually be drawn. */
.product-image-marker {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid var(--vm-accent);
  border-radius: 50%;
  background: rgba(122, 106, 232, 0.35);
  pointer-events: none;
}
.product-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin-bottom: 6px;
}

/* Library tiles are <video> now, not <img>; match the old framing exactly so
   the grid does not reflow when a clip loads its first frame. */
.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

/* The Videos and Product Image modals sit on Materialize's white modal, but
   the builder's own dark rules were bleeding into browser-default selects --
   white text on a white field. Pin both explicitly rather than relying on
   inheritance, and give the inline labels room so they cannot collide with the
   control beneath them. */
#modal-videos .browser-default,
#modal-product-image .browser-default {
  color: #212121;
  background-color: var(--vm-ink);
  border: 1px solid #9e9e9e;
  border-radius: 3px;
  height: 3rem;
  padding: 0 8px;
  width: 100%;
}
#modal-videos .browser-default option,
#modal-product-image .browser-default option {
  color: #212121;
  background-color: var(--vm-ink);
}
.video-inline-label {
  display: block;
  font-size: 12px;
  color: #616161;
  margin: 0 0 4px;
  line-height: 1.2;
}
/* Materialize reserves no space for a label above a browser-default select, so
   the rows were stacking on top of each other. */
#modal-videos .video-overlay-row .input-field,
#modal-product-image .video-overlay-row .input-field {
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
}
#modal-videos .assist-status,
#modal-product-image .assist-status {
  color: #616161;
  min-height: 1.2em;
}

/* Materialize sets .input-field label { position: absolute; top: 0 }, so a
   label inside one is painted over the control no matter where it sits in the
   DOM -- which is why "Where" was sitting on top of the Bottom select. These
   are plain captions above browser-default selects, not floating labels, so
   take them out of that positioning entirely. */
#modal-videos .input-field label.video-inline-label,
#modal-product-image .input-field label.video-inline-label {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  font-size: 12px;
  color: #616161;
  display: block;
  margin: 0 0 4px;
  pointer-events: auto;
}

/* The builder's dark theme colours inputs for a dark page, but Materialize
   modals are white -- so inside these two the text and the resting label were
   both painted near-white on white. Scoped to the modals rather than fixing it
   globally, because the dark styling is correct everywhere else. */
#modal-videos input[type="text"],
#modal-videos input[type="url"],
#modal-videos textarea,
#modal-videos .select-dropdown,
#modal-product-image input[type="text"],
#modal-product-image input[type="url"],
#modal-product-image textarea,
#modal-product-image .select-dropdown {
  color: #212121;
  -webkit-text-fill-color: #212121;   /* some UA styles win over `color` alone */
  background-color: transparent;
}
#modal-videos input::placeholder,
#modal-product-image input::placeholder {
  color: #9e9e9e;
  -webkit-text-fill-color: #9e9e9e;
  opacity: 1;                          /* Firefox dims placeholders by default */
}
/* The floating label at rest, which is the state that was unreadable. */
#modal-videos label,
#modal-product-image label {
  color: #616161;
}
#modal-videos label.active,
#modal-product-image label.active {
  color: #ffffff;
}
/* Materialize's dropdown is a separate white panel appended to the body, so it
   is outside both modals and needs its own rule. */
.select-dropdown.dropdown-content li > span {
  color: #212121;
}

/* The tile and its caption are one grid cell. Without this wrapper the input
   lands in the next column and every caption sits under the wrong picture. */
.ai-image-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
