.inbox-demo {
  background: #f8f8f9;
  color: #18181b;
  padding: clamp(40px, 6vw, 76px) 20px;
}

.inbox-demo__layout {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 430px);
  align-items: center;
  gap: clamp(32px, 5.2vw, 68px);
  max-width: 1040px;
  margin-inline: auto;
}

.inbox-demo__window {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
  min-height: 500px;
  overflow: hidden;
  border: 1px solid #e8e8eb;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 32px 45px -16px rgb(25 38 54 / 47%), 0 4px 10px rgb(25 38 54 / 6%);
  font-size: 11px;
  line-height: 1.45;
}

.inbox-demo__picker { display: none; }

.inbox-demo__sidebar {
  padding: 12px 5px;
  border-right: 1px solid #ededf0;
}

.inbox-demo__sidebar h3 {
  margin: 0 8px 5px;
  padding: 7px 0 15px;
  border-bottom: 1px solid #ededf0;
  color: inherit;
  line-height: 1.25;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.inbox-demo__contact {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 5px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.inbox-demo__contact:hover,
.inbox-demo__contact[aria-pressed="true"] {
  background: #f3f3f5;
}

.inbox-demo__contact:focus-visible,
.inbox-demo__copy a:focus-visible {
  outline: 2px solid #7354ed;
  outline-offset: -2px;
}

.inbox-demo__identity {
  min-width: 0;
}

.inbox-demo__identity strong,
.inbox-demo__identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-demo__identity strong {
  font-size: 11px;
  font-weight: 600;
}

.inbox-demo__identity small {
  color: #555764;
  font-size: 10px;
}

.inbox-demo__avatar {
  position: relative;
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #ece9fa;
  color: #55457b;
  font-size: 9px;
  font-weight: 700;
}

.inbox-demo__avatar img {
  width: 28px;
  height: 28px;
  border-radius: inherit;
  object-fit: cover;
}

.inbox-demo__badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border: 1px solid #fff;
  border-radius: 50%;
}

.inbox-demo__badge--whatsapp { background: #159b55; }
.inbox-demo__badge--instagram { background: linear-gradient(135deg, #824cf3, #e33480 65%, #ff944e); }

.inbox-demo__thread {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 0 8px 14px;
  background: #f9f9fa;
}

.inbox-demo__thread-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  border-bottom: 1px solid #ededf0;
}

.inbox-demo__messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0;
}

.inbox-demo__messages p {
  max-width: 94%;
  margin: 0;
  padding: 12px 10px;
  border-radius: 9px;
  color: #26262b;
  font-size: 11px;
  line-height: 1.55;
}

.inbox-demo__incoming { background: #efeff1; }
.inbox-demo__messages .inbox-demo__outgoing { align-self: flex-end; background: #fff; }

.inbox-demo__thread[data-opened] .inbox-demo__messages {
  animation: inbox-demo-enter 260ms ease both;
}

@keyframes inbox-demo-enter {
  from { opacity: 0; transform: translateY(4px); }
}

.inbox-demo__composer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 12px 10px;
  border: 1px solid #e8e8eb;
  border-radius: 12px;
  background: #fff;
  color: #555764;
  box-shadow: 0 3px 8px rgb(25 38 54 / 6%);
}

.inbox-demo__eyebrow {
  color: #7044bf;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
}

.inbox-demo__copy h2 {
  margin: 8px 0 16px;
  color: inherit;
  font-size: clamp(30px, 4vw, 43px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.048em;
  text-wrap: balance;
}

.inbox-demo__copy p {
  max-width: 390px;
  margin: 0 0 25px;
  color: #555764;
  font-size: 17px;
  line-height: 1.48;
}

.inbox-demo__copy a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #18181b;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.inbox-demo__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 819px) {
  .inbox-demo {
    padding-inline: 16px;
  }

  .inbox-demo__layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    max-width: 540px;
  }

  .inbox-demo__copy p {
    margin-bottom: 18px;
    font-size: 16px;
  }

  .inbox-demo__copy a {
    justify-content: center;
    min-height: 46px;
    font-size: 14px;
  }

  .inbox-demo__window {
    grid-area: auto;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    border-radius: 18px;
    box-shadow: 0 16px 32px -16px rgb(25 38 54 / 35%), 0 3px 8px rgb(25 38 54 / 6%);
  }

  .inbox-demo__sidebar {
    display: none;
  }

  .inbox-demo__picker:not([hidden]) {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid #e8e8eb;
    font-size: 15px;
    font-weight: 700;
  }

  .inbox-demo__picker select {
    width: 100%;
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid #dedce8;
    border-radius: 9px;
    background: #f7f6fb;
    color: #242139;
    font: 500 16px / 1.3 Inter, system-ui, sans-serif;
  }

  .inbox-demo__picker select:focus-visible {
    outline: 2px solid #7354ed;
    outline-offset: 2px;
  }

  .inbox-demo__thread {
    padding-inline: 12px;
  }

  .inbox-demo__identity strong {
    font-size: 14px;
  }

  .inbox-demo__identity small {
    font-size: 12px;
  }

  .inbox-demo__messages {
    min-height: 155px;
    gap: 9px;
  }

  .inbox-demo__messages p {
    max-width: 90%;
    padding: 9px 11px;
    font-size: 13px;
  }

  .inbox-demo__messages [data-inbox-followup] {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .inbox-demo__thread[data-opened] .inbox-demo__messages { animation: none; }
}

.inbox-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 22px);
  max-width: 1040px;
  margin: clamp(20px, 3vw, 36px) auto 0;
}

.inbox-features__card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e7e7ea;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 12px rgb(25 38 54 / 5%);
}

.inbox-features__visual {
  height: clamp(360px, 40vw, 470px);
}

.inbox-features__visual--tiles {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.inbox-features__tiles {
  display: grid;
  width: 108%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 24px);
  transform: rotate(5deg);
}

.inbox-features__tile {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #e9e9ec;
  border-radius: 24%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(25 38 54 / 5%);
  color: #7255df;
}

.inbox-features__tile:nth-child(8n + 5) { color: #1979db; }
.inbox-features__tile:nth-child(8n + 6) { color: #09876e; }

.inbox-features__tile > :is(img, svg) {
  width: 48%;
  height: auto;
  border-radius: 21%;
}

.inbox-features__channel--whatsapp { background: #159b55; }
.inbox-features__channel--instagram { background: linear-gradient(135deg, #824cf3, #e33480 65%, #ff944e); }

.inbox-features__sequence {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 0;
  padding: clamp(34px, 5vw, 50px) 16px;
  list-style: none;
  background: radial-gradient(circle, #e8e5f0 1px, transparent 1px) 0 0 / 13px 13px;
}

.inbox-features__sequence li {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(100%, 240px);
  min-height: 98px;
  padding: 25px 14px 14px;
  border: 1px solid #8059ff;
  border-radius: 11px;
  background: #fff;
  text-align: center;
  box-shadow: 0 4px 9px rgb(25 38 54 / 7%);
}

.inbox-features__sequence li:not(:last-child)::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: 30px;
  background: #e8e5f0;
  content: "";
}

.inbox-features__step-icon {
  position: absolute;
  top: 0;
  left: 50%;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid #eeeef1;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 0 0 8px #fff;
}

.inbox-features__step-icon--dark { background: #222225; color: #fff; }

.inbox-features__step-icon svg,
.inbox-features__wait svg { width: 20px; height: 20px; }

.inbox-features__sequence strong { font-size: 14px; font-weight: 500; }

.inbox-features__sequence small {
  max-width: 180px;
  color: #555764;
  font-size: 12px;
  line-height: 1.45;
}

.inbox-features__sequence .inbox-features__wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: auto;
  min-height: 50px;
  padding: 10px 18px;
}

.inbox-features__copy { padding: 20px 24px 24px; }

.inbox-features__copy h3 {
  margin: 0 0 3px;
  color: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
}

.inbox-features__copy p {
  margin: 0;
  color: #555764;
  font-size: 14px;
  line-height: 1.55;
}

@media (max-width: 819px) {
  .inbox-features {
    max-width: 540px;
    margin-top: 20px;
  }

  .inbox-features__visual {
    height: 290px;
  }

  .inbox-features__sequence {
    gap: 20px;
    padding: 23px 12px 14px;
  }

  .inbox-features__sequence li {
    min-height: 0;
    padding-block: 18px 8px;
  }

  .inbox-features__step-icon {
    width: 28px;
    height: 28px;
    box-shadow: 0 0 0 4px #fff;
  }

  .inbox-features__sequence .inbox-features__wait {
    min-height: 36px;
    padding-block: 5px;
  }

  .inbox-features__copy {
    padding: 15px 16px 18px;
  }
}

@media (max-width: 560px) {
  .inbox-features {
    grid-template-columns: minmax(0, 1fr);
  }

  .inbox-features__visual--tiles {
    height: clamp(170px, 52vw, 240px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .inbox-features__visual {
    --inbox-motion-play: paused;
  }

  .inbox-features [data-motion-visible] {
    --inbox-motion-play: running;
  }

  .inbox-features__visual[data-motion-started] .inbox-features__tiles {
    animation: inbox-tiles-drift 10s ease-in-out infinite var(--inbox-motion-play);
  }

  .inbox-features__visual[data-motion-started] .inbox-features__tile:nth-child(2),
  .inbox-features__visual[data-motion-started] .inbox-features__tile:nth-child(6),
  .inbox-features__visual[data-motion-started] .inbox-features__tile:nth-child(7) {
    animation: inbox-tile-activate 10s ease-in-out var(--inbox-beat, 0s) infinite var(--inbox-motion-play);
  }

  .inbox-features__tile:nth-child(2) { --inbox-beat: 2s; }
  .inbox-features__tile:nth-child(6) { --inbox-beat: 4s; }

  .inbox-features__sequence[data-motion-started] li {
    animation: inbox-step-activate 10s ease-in-out var(--inbox-beat, 0s) infinite var(--inbox-motion-play);
  }

  .inbox-features__sequence li:nth-child(2) { --inbox-beat: 2.6s; }
  .inbox-features__sequence li:nth-child(3) { --inbox-beat: 5.2s; }

  .inbox-features__sequence[data-motion-started] li:not(:last-child)::before {
    position: absolute;
    z-index: 1;
    top: 100%;
    left: calc(50% - 1px);
    width: 3px;
    height: 30px;
    border-radius: 3px;
    background: #8059ff;
    opacity: 0;
    animation: inbox-step-connect 10s ease-in-out var(--inbox-beat, 0s) infinite var(--inbox-motion-play);
    content: "";
  }
}

@keyframes inbox-tiles-drift {
  0%, 100% { translate: 0 0; }
  28% { translate: -2% -2%; }
  63% { translate: 2% 1%; }
}

@keyframes inbox-tile-activate {
  0%, 31%, 100% {
    scale: 1;
    box-shadow: 0 1px 2px rgb(25 38 54 / 5%);
  }
  12%, 21% {
    scale: 1.045;
    box-shadow: 0 0 0 1px #c2b2ff, 0 5px 16px rgb(114 85 223 / 22%);
  }
}

@keyframes inbox-step-activate {
  0%, 33%, 100% {
    background: #fff;
    box-shadow: 0 4px 9px rgb(25 38 54 / 7%);
  }
  10%, 21% {
    background: #f8f5ff;
    box-shadow: 0 0 0 3px rgb(128 89 255 / 17%), 0 5px 12px rgb(74 45 164 / 13%);
  }
}

@keyframes inbox-step-connect {
  0%, 15%, 34%, 100% { opacity: 0; }
  18%, 28% { opacity: 1; }
  15% { transform: translateY(0) scaleY(.24); }
  34% { transform: translateY(23px) scaleY(.24); }
}
