/**
 * Automation stage layer + snappy login-style expand + static hero.
 */

.chat-stage__pane--automation {
  position: absolute;
  inset: 0;
  z-index: 3;
  transform: translate3d(0, -108%, 0);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.chat-stage__pane--automation:not([hidden]) {
  visibility: visible;
}

#win-chat[data-stage="automation"] .chat-stage__pane--automation {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  pointer-events: auto;
}

#win-chat[data-stage="automation"] .chat-stage__pane--automation[hidden] {
  display: flex !important;
}

.automation-pane {
  background:
    linear-gradient(180deg, var(--sw-surface-wash) 0%, transparent 120px),
    transparent;
  color: var(--sw-text-main);
}

/* Exit/back on the same band as sidebar «Starkwork Pro» / settings header. */
.automation-pane > .settings-pane__header {
  margin-top: 14px;
}

.automation-pane__body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.automation-pane__body::-webkit-scrollbar {
  display: none;
}

.automation-stub {
  --auto-expand-ease: cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  max-width: 520px;
  min-height: min(560px, calc(100% - 8px));
  margin: -18px auto 0;
  overflow: hidden;
  border-radius: 18px;
  background: transparent;
  transition: max-width 0.58s var(--auto-expand-ease);
}

.automation-stub.is-expanded {
  max-width: min(1080px, 96%);
}

.automation-stub__visual {
  margin: 0;
  flex: 0 0 auto;
  width: min(520px, 100%);
  min-height: 560px;
  background: #0c0c0e;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  z-index: 2;
  transition: border-radius 0.45s var(--auto-expand-ease);
}

.automation-stub.is-expanded .automation-stub__visual {
  border-radius: 18px 0 0 18px;
}

.automation-stub__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  background: #0c0c0e;
}

.automation-stub__copy {
  flex: 0 0 0;
  width: 0;
  max-width: 0;
  min-width: 0;
  min-height: 560px;
  opacity: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 20px;
  padding: 0;
  box-sizing: border-box;
  background: var(--sw-surface-card);
  border-radius: 0 18px 18px 0;
  transform: translateX(-22px) scaleX(0.94);
  transform-origin: left center;
  pointer-events: none;
  z-index: 1;
  transition:
    flex-basis 0.58s var(--auto-expand-ease),
    width 0.58s var(--auto-expand-ease),
    max-width 0.58s var(--auto-expand-ease),
    opacity 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.05s,
    transform 0.58s var(--auto-expand-ease),
    padding 0.58s var(--auto-expand-ease);
}

.automation-stub.is-expanded .automation-stub__copy {
  flex: 0 0 400px;
  width: 400px;
  max-width: 400px;
  opacity: 1;
  padding: 36px 40px 40px;
  transform: translateX(0) scaleX(1);
  pointer-events: auto;
}

.automation-stub__welcome {
  margin: 0;
  font-family: var(--sw-font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--sw-text-main);
}

.automation-stub__lead,
.automation-stub__note {
  margin: 0;
  font-family: var(--sw-font);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--sw-text-muted);
}

.automation-stub__note {
  margin-top: -6px;
  overflow: visible;
}

/* Reserve full width for all 3 dots — parent overflow:hidden was clipping the last. */
.automation-stub__dots {
  display: inline-flex;
  flex-shrink: 0;
  margin-left: 0.02em;
  min-width: 1.35em;
  padding-right: 0.2em;
  box-sizing: content-box;
  vertical-align: baseline;
}

.automation-stub__dots .composer-ph__dot {
  width: 0.35em;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .automation-stub__dots .composer-ph__dot {
    animation: none !important;
    opacity: 0.9;
  }
}

.automation-stub__cta {
  margin-top: auto;
  align-self: stretch;
  width: 100%;
  min-height: 50px;
  font-family: "Syne", "Manrope", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

@media (max-width: 860px) {
  .automation-pane > .settings-pane__header {
    margin-top: 14px;
  }

  .automation-stub,
  .automation-stub.is-expanded {
    flex-direction: column;
    max-width: min(520px, 100%);
    min-height: 0;
    margin-top: 0;
  }

  .automation-stub__visual,
  .automation-stub.is-expanded .automation-stub__visual {
    width: 100%;
    min-height: 360px;
    max-height: 440px;
    border-radius: 18px 18px 0 0;
  }

  .automation-stub__copy {
    min-height: 0;
    transform: translateY(-12px) scaleY(0.96);
    transform-origin: top center;
  }

  .automation-stub.is-expanded .automation-stub__copy {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    padding: 26px 24px 28px;
    border-radius: 0 0 18px 18px;
    transform: translateY(0) scaleY(1);
  }

  .automation-stub__welcome {
    font-size: 24px;
  }

  .automation-stub__lead,
  .automation-stub__note {
    font-size: 17px;
  }

  .automation-stub__cta {
    margin-top: 22px;
    min-height: 48px;
    font-size: 15px;
  }
}

/* Mobile: shift only the hero card — do not touch pane background / flex canvas. */
body.is-mobile .automation-stub,
body.is-mobile .automation-stub.is-expanded {
  margin-top: 0;
  transform: translateY(12px);
}

@media (prefers-reduced-motion: reduce) {
  .automation-stub,
  .automation-stub__visual,
  .automation-stub__copy {
    transition: none !important;
  }
}
