/* PromptMyImage 1.2.4 — refined React islands with stable proportions and accessibility. */
body.home .pmi-react-demo {
  display: grid;
  grid-template-columns: minmax(230px, .78fr) minmax(0, 1.55fr);
  min-height: 100%;
}
body.home .pmi-react-demo-source,
body.home .pmi-react-demo-output {
  min-width: 0;
  padding: 18px;
}
body.home .pmi-react-demo-source {
  border-right: 1px solid #e5eaf4;
  background: linear-gradient(180deg, #fbfcff 0%, #f7f9ff 100%);
}
body.home .pmi-react-image-stage {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  aspect-ratio: 4 / 3;
  margin: 8px 0 14px;
  background: #eef2f8;
}
body.home .pmi-react-image-stage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
body.home .pmi-react-scan-line {
  position: absolute;
  left: 0;
  right: 0;
  top: -4px;
  height: 3px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, #4f7cff, #d91ac6, transparent);
  box-shadow: 0 0 18px rgba(109, 77, 255, .6);
}
body.home .phase-1 .pmi-react-scan-line,
body.home .phase-2 .pmi-react-scan-line {
  opacity: 1;
  animation: pmiReactScan 1.35s ease-in-out infinite;
}
body.home .pmi-react-analysis-chip {
  position: absolute;
  z-index: 2;
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 999px;
  background: rgba(12, 25, 54, .78);
  color: #fff;
  font: 600 14px/1.2 Poppins, sans-serif;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .25s ease, transform .25s ease;
  backdrop-filter: blur(8px);
}
body.home .phase-2 .pmi-react-analysis-chip,
body.home .phase-3 .pmi-react-analysis-chip { opacity: 1; transform: none; }
body.home .chip-subject { left: 8%; bottom: 12%; }
body.home .chip-light { right: 8%; top: 12%; transition-delay: .12s; }
body.home .chip-composition { right: 7%; bottom: 10%; transition-delay: .22s; }
body.home .pmi-react-demo-output { display: grid; align-content: start; gap: 12px; }
body.home .pmi-react-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 3px;
}
body.home .pmi-react-tabs button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #e2e7f1;
  border-radius: 9px;
  background: #f7f8fc;
  color: #536078;
  font: 600 14px/1.25 Poppins, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
body.home .pmi-react-tabs button.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(100deg, #2f75ff, #d919c3);
  box-shadow: 0 7px 18px rgba(90, 71, 225, .18);
}
body.home .pmi-react-prompt-copy {
  min-height: 132px;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .3s ease, transform .3s ease;
}
body.home .phase-3 .pmi-react-prompt-copy { opacity: 1; transform: none; }
body.home .pmi-react-inline-copy {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #315cff;
  font: 600 14px/1.3 Poppins, sans-serif;
  cursor: pointer;
}

body.home .pmi-react-stepper {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 26px;
}
body.home .pmi-react-stepper-line {
  position: absolute;
  top: 43px;
  left: 16.5%;
  right: 16.5%;
  height: 2px;
  background: #e4e8f1;
  overflow: hidden;
}
body.home .pmi-react-stepper-line span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #5175ff, #b82bd6, #29c987);
  transition: width .6s ease;
}
body.home .pmi-react-stepper button {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  text-align: center;
  cursor: pointer;
  color: inherit;
  font-family: Poppins, sans-serif;
}
body.home .pmi-react-step-number {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 8px;
  border-radius: 50%;
  color: #8490a8;
  background: #f1f4f9;
  font-size: 14px;
  font-weight: 700;
}
body.home .pmi-react-step-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border: 1px solid #e0e5ef;
  border-radius: 50%;
  background: #fff;
  color: #6d4cff;
  box-shadow: 0 10px 25px rgba(38, 48, 84, .06);
  font-size: 25px;
  transition: transform .3s ease, color .3s ease, border-color .3s ease, background .3s ease;
}
body.home .pmi-react-stepper button.is-active .pmi-react-step-icon {
  transform: translateY(-3px);
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #5a6fff, #b82bd6);
}
body.home .pmi-react-stepper button:last-child.is-active .pmi-react-step-icon { background: linear-gradient(135deg, #5a6fff, #27c889); }
body.home .pmi-react-stepper h3 { margin: 0 0 6px; font-size: 17px; }
body.home .pmi-react-stepper p { max-width: 280px; margin: 0 auto; color: #6b7690; font-size: 14px; line-height: 1.55; }

body.home .pmi-react-comparison { display: grid; gap: 14px; }
body.home .pmi-react-comparison h2 { margin: 0; }
body.home .pmi-react-compare-toggle {
  display: inline-flex;
  width: fit-content;
  padding: 4px;
  border-radius: 11px;
  background: #f0f3f9;
}
body.home .pmi-react-compare-toggle button {
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #667189;
  font: 600 14px/1.2 Poppins, sans-serif;
  cursor: pointer;
}
body.home .pmi-react-compare-toggle button.is-active { background: #fff; color: #192743; box-shadow: 0 3px 10px rgba(29, 38, 67, .08); }
body.home .pmi-react-text-comparison { display: grid; gap: 10px; }
body.home .pmi-react-text-comparison article { padding: 14px; border: 1px solid #e4e8f1; border-radius: 12px; background: #f8f9fc; }
body.home .pmi-react-text-comparison article.is-complete { border-color: #cfc8ff; background: #f8f6ff; }
body.home .pmi-react-text-comparison span { font-size: 14px; font-weight: 700; color: #6e4fff; }
body.home .pmi-react-text-comparison p { margin: 7px 0 0; font-size: 14px; line-height: 1.6; }

body.home .pmi-react-explorer { display: grid; gap: 14px; }
body.home .pmi-react-explorer h2 { margin: 0; }
body.home .pmi-react-example-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
body.home .pmi-react-example-grid button {
  overflow: hidden;
  padding: 0;
  border: 1px solid #e4e8f1;
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
body.home .pmi-react-example-grid button:hover,
body.home .pmi-react-example-grid button.is-active {
  transform: translateY(-2px);
  border-color: #8e79ff;
  box-shadow: 0 9px 22px rgba(38, 48, 84, .08);
}
body.home .pmi-react-example-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
body.home .pmi-react-example-grid button > span { display: grid; padding: 10px; }
body.home .pmi-react-example-grid strong { font-size: 14px; }
body.home .pmi-react-example-grid small { margin-top: 3px; color: #78839a; font-size: 14px; }
body.home .pmi-react-example-detail {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1.35fr);
  gap: 18px;
  padding: 14px;
  border: 1px solid #e3e8f1;
  border-radius: 14px;
  background: #fbfcff;
}
body.home .pmi-react-example-detail > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 11px; }
body.home .pmi-react-example-detail h3 { margin: 5px 0 7px; font-size: 20px; }
body.home .pmi-react-example-detail p { margin: 0; color: #59657e; font-size: 14px; line-height: 1.65; }
body.home .pmi-react-example-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
body.home .pmi-react-example-tags span { padding: 5px 8px; border-radius: 999px; background: #f0edff; color: #6648d8; font-size: 14px; font-weight: 600; }
body.home .pmi-react-example-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }

body.home .pmi-react-faq-list { display: grid; gap: 8px; }
body.home .pmi-react-faq-list article { overflow: hidden; border: 1px solid #e2e7f0; border-radius: 10px; background: #fff; }
body.home .pmi-react-faq-list h3 { margin: 0; }
body.home .pmi-react-faq-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  min-height: 48px;
  padding: 12px 15px;
  border: 0;
  background: transparent;
  color: #182641;
  text-align: left;
  font: 600 14px/1.45 Poppins, sans-serif;
  cursor: pointer;
}
body.home .pmi-react-faq-list article.is-open button { color: #5b40d3; }
body.home .pmi-react-faq-plus { flex: 0 0 auto; font-size: 21px; font-weight: 500; }
body.home .pmi-react-faq-answer { padding: 0 15px 14px; }
body.home .pmi-react-faq-answer p { margin: 0; color: #63708a; font-size: 14px; line-height: 1.65; }

@keyframes pmiReactScan {
  from { top: -3px; }
  to { top: calc(100% + 3px); }
}

@media (max-width: 1100px) {
  body.home .pmi-react-example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  body.home .pmi-react-demo { grid-template-columns: 1fr; }
  body.home .pmi-react-demo-source { border-right: 0; border-bottom: 1px solid #e5eaf4; }
  body.home .pmi-react-stepper { grid-template-columns: 1fr; gap: 18px; }
  body.home .pmi-react-stepper-line { display: none; }
  body.home .pmi-react-example-detail { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body.home .pmi-react-example-grid { grid-template-columns: 1fr; }
  body.home .pmi-react-demo-source,
  body.home .pmi-react-demo-output { padding: 14px; }
  body.home .pmi-react-example-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  body.home .pmi-react-scan-line { display: none !important; }
  body.home .pmi-react-analysis-chip,
  body.home .pmi-react-prompt-copy,
  body.home .pmi-react-step-icon,
  body.home .pmi-react-stepper-line span,
  body.home .pmi-react-example-grid button { transition: none !important; animation: none !important; }
  body.home .pmi-react-analysis-chip,
  body.home .pmi-react-prompt-copy { opacity: 1; transform: none; }
}

/* Neutralize the server fallback layout once an island is mounted. */
body.home #pmi-react-prompt-demo.is-react-mounted,
body.home #pmi-react-stepper.is-react-mounted,
body.home #pmi-react-comparison.is-react-mounted,
body.home #pmi-react-examples.is-react-mounted,
body.home #pmi-react-faq.is-react-mounted {
  display: block;
}
body.home #pmi-react-prompt-demo.is-react-mounted { padding: 0; overflow: hidden; }


/* v1.2.4: React islands must preserve the approved homepage geometry. */
body.home .pmi-v118-hero-grid {
  grid-template-columns: minmax(360px, .72fr) minmax(720px, 1.28fr) !important;
  gap: clamp(40px, 4vw, 72px) !important;
}
body.home #pmi-react-prompt-demo.pmi-v118-demo-card {
  width: 100%;
  min-width: 0;
  grid-template-columns: none !important;
}
body.home .pmi-react-demo {
  grid-template-columns: minmax(280px, 38%) minmax(0, 62%);
  min-height: 520px;
}
body.home .pmi-react-demo-source,
body.home .pmi-react-demo-output { padding: 22px; }
body.home .pmi-react-demo-output { position: relative; gap: 14px; }
body.home .pmi-react-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  padding: 0 10px 8px 0;
}
body.home .pmi-react-tabs::after {
  content: '';
  flex: 0 0 12px;
}
body.home .pmi-react-tabs button {
  flex: 0 0 auto;
  min-width: max-content;
  min-height: 42px;
  scroll-snap-align: start;
}
body.home .pmi-react-prompt-copy {
  min-height: 190px;
  font-size: 15px !important;
  line-height: 1.7 !important;
}
body.home .pmi-v118-negative p,
body.home .pmi-v118-analysis :is(dt,dd),
body.home .pmi-react-demo-output :is(p,span,a,button) {
  font-size: max(14px, .875rem);
}

/* Numbered hotspots replace overlapping text chips. */
body.home .pmi-react-analysis-chip {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid rgba(255,255,255,.95);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(11,25,54,.28);
}
body.home .pmi-react-analysis-chip::after {
  position: absolute;
  min-width: max-content;
  padding: 6px 9px;
  border-radius: 8px;
  background: #0d1b35;
  color: #fff;
  font: 600 14px/1.25 Poppins, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  transition: opacity .18s ease, transform .18s ease;
}
body.home .chip-subject::after { content: 'Subject'; left: 35px; bottom: 0; }
body.home .chip-light::after { content: 'Lighting'; right: 35px; top: 0; }
body.home .chip-composition::after { content: 'Composition'; right: 35px; bottom: 0; }
body.home .pmi-react-analysis-chip:hover::after,
body.home .pmi-react-analysis-chip:focus-visible::after { opacity: 1; transform: none; }

/* Stronger, more compact stepper. */
body.home .pmi-react-stepper { gap: 22px; margin-top: 18px; }
body.home .pmi-react-stepper-line { top: 39px; height: 3px; }
body.home .pmi-react-step-number {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  width: 24px;
  height: 24px;
  margin: 0;
  transform: translate(-50%, -38%);
  background: #fff;
  border: 1px solid #dfe4ef;
  color: #5b4ae1;
}
body.home .pmi-react-step-icon {
  width: 52px;
  height: 52px;
  margin: 14px auto 10px;
  font-size: 22px;
}
body.home .pmi-react-stepper h3 { font-size: 18px; margin-bottom: 5px; }
body.home .pmi-react-stepper p { font-size: 15px; line-height: 1.55; }

/* Keep comparison and example explorer balanced. */
body.home .pmi-v118-proof-grid {
  grid-template-columns: minmax(410px, .88fr) minmax(0, 1.52fr) !important;
  align-items: start !important;
}
body.home .pmi-react-comparison,
body.home .pmi-react-explorer { min-width: 0; }
body.home .pmi-react-comparison :is(p,span,a,button),
body.home .pmi-react-explorer :is(p,span,small,strong,a,button) {
  font-size: max(14px, .875rem);
}
body.home .pmi-react-example-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}
body.home .pmi-react-example-grid img {
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  object-fit: cover !important;
}
body.home .pmi-react-example-grid button > span { min-height: 74px; align-content: start; }
body.home .pmi-react-example-grid small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.45;
}
body.home .pmi-react-example-detail {
  grid-template-columns: minmax(220px, 34%) minmax(0, 66%);
  align-items: start;
  max-height: none;
  padding: 16px;
}
body.home .pmi-react-example-detail > img { max-height: 280px; }
body.home .pmi-react-example-detail p:not(.is-expanded) {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
}
body.home .pmi-react-expand-prompt {
  min-height: 38px !important;
  margin-top: 8px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: #4e57d9;
  font: 700 14px/1.3 Poppins, sans-serif;
  cursor: pointer;
}

/* Shared button geometry for React controls. */
body.home .pmi-react-demo .btn,
body.home .pmi-react-example-actions .btn,
body.home .pmi-react-inline-copy,
body.home .pmi-react-expand-prompt {
  border-radius: 10px;
  font-size: 14px !important;
  font-weight: 650;
}
body.home .pmi-react-demo .btn,
body.home .pmi-react-example-actions .btn { min-height: 42px; padding: 9px 14px; }

/* FAQ readability. */
body.home .pmi-react-faq-list button {
  min-height: 52px;
  padding: 14px 18px;
  font-size: 15px;
}
body.home .pmi-react-faq-plus { font-size: 22px; }
body.home .pmi-react-faq-answer { padding: 0 18px 16px; }
body.home .pmi-react-faq-answer p { font-size: 15px; }
body.home .pmi-react-faq-list article.is-open { border-color: #bdb3ff; box-shadow: 0 8px 22px rgba(88,67,190,.07); }

@media (max-width: 1280px) {
  body.home .pmi-v118-hero-grid { grid-template-columns: 1fr !important; }
  body.home .pmi-react-demo { grid-template-columns: minmax(260px, 36%) minmax(0, 64%); }
  body.home .pmi-v118-proof-grid { grid-template-columns: 1fr !important; }
  body.home .pmi-react-comparison { max-width: none; }
}
@media (max-width: 980px) {
  body.home .pmi-react-demo { grid-template-columns: 1fr; min-height: 0; }
  body.home .pmi-react-example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.home .pmi-react-example-detail { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body.home .pmi-react-example-grid { grid-template-columns: 1fr; }
  body.home .pmi-react-step-number { position: static; transform: none; margin: 0 auto 4px; }
}
