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

.sitebuilder-progress {
  min-height: 56px;
}

.sitebuilder-progress .chip {
  margin-right: 8px;
}

#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 rgba(255, 255, 255, 0.25);
  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: #ff5722;
  box-shadow: 0 0 0 2px rgba(255, 87, 34, 0.3);
}

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

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

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

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

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

.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 #e0e6ed;
  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 #d9e1ea;
  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 #d6dce4;
  border-radius: 8px;
  background: #fafbfc;
}

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

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

.image-gen-loading {
  position: absolute;
  inset: 0;
  background: rgba(16, 22, 32, 0.72);
  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 rgba(0, 0, 0, 0.22);
}

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

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

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

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

.site-preview {
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  min-height: 220px;
  padding: 18px;
  background: #111;
}

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

.image-library-panel {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.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 rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(9, 13, 20, 0.45);
}

.image-library-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #fff;
}

.image-library-url {
  font-size: 0.82rem;
  color: #c8d5e4;
  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;
}

.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 #2f3b52;
  border-radius: 8px;
  background: #111827;
  color: #dbeafe;
  font-weight: 600;
}

.rendered-page-card {
  background: #0d1118;
  border: 1px solid #253045;
  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 #253045;
}

.rendered-page-head h6 {
  margin: 0;
  color: #f3f5f8;
}

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

.rendered-preview-pill {
  font-size: 0.72rem;
  color: #90a4ae;
  border: 1px solid #2f3b4f;
  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 #253045;
  padding: 12px;
  background: #0b0f16;
}

.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 #1f2a3b;
  background: #fff;
}

.rendered-mobile-frame {
  width: 300px;
  max-width: 100%;
  height: 540px;
  border: 2px solid #1f2a3b;
  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-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-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-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-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 {
  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 {
  fill: #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 #ff5722 !important;
  box-shadow: 0 1px 0 0 #ff5722 !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: #ff5722 !important;
}

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

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

  .sitebuilder-progress .chip {
    margin-bottom: 8px;
  }

  .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;
  }
}
