/* Dental partnership block and its local design alternatives. */
.zm-dental {
  --space: clamp(22px, 4vw, 60px);
  --ink: #203937;
  --tint: #41665f;
  --angle: 3deg;
}
.zm-dental .zm-direct-scene {
  isolation: isolate;
  grid-template-columns: minmax(0,1.15fr) minmax(260px,.85fr);
  padding: 24px var(--space);
  gap: clamp(18px, 3vw, 48px);
}
#project-chat .zm-dental h2 {
  max-width: 16ch;
  font-size: clamp(34px, 4vw, 57px);
  line-height: 1.02;
  letter-spacing: -.035em;
  color: var(--ink);
}
#project-chat .zm-dental h2 em { color: var(--tint); }
.zm-dental .zm-direct-copy > p { font-size: 17px; max-width: 39ch; line-height: 1.47; }
.zm-dental .zm-direct-copy .zm-direct-links { gap: 6px 14px; }
.zm-dental .zm-direct-device-wrap { padding: 12px 4px; }
.zm-dental .zm-direct-device {
  width: min(100%,258px);
  transform: rotate(var(--angle));
  filter: drop-shadow(1px 3px 2px #26392e33) drop-shadow(5px 12px 11px #26392e24);
}
.zm-dental .zm-direct-account { padding: 7px 9px; }
.zm-dental .zm-direct-screen {
  align-content: safe center; gap: 6px; padding: 8px;
  background: radial-gradient(ellipse at 0 0,#fbfbf3,transparent 70%),linear-gradient(140deg,#e2ede9,#d7e6e9);
}
.zm-dental .zm-direct-bubble {
  font-size: 14px; line-height: 1.31; padding: 6px 9px; max-width: 96%;
  text-align: left; color: #213831;
}
.zm-dental .zm-direct-bubble.is-mine { background: #d6ebf8; }
.zm-dental .zm-chat-time { display: inline-block; margin: 0 0 0 3px; font-size: 9px; white-space: nowrap; }
.zm-dental-speaker {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.zm-dental .zm-direct-bubble { animation: none; }
.zm-chat-compare:has(a:nth-child(5)) { gap: 4px 6px; }
@media (prefers-reduced-motion: no-preference) {
  .zm-direct[data-play-chat] .zm-dental .zm-direct-bubble { animation: zm-chat-arrives .22s ease-out both; }
  .zm-direct[data-play-chat] .zm-dental .zm-direct-bubble:nth-child(2) { animation-delay: .18s; }
  .zm-direct[data-play-chat] .zm-dental .zm-direct-bubble:nth-child(3) { animation-delay: .36s; }
  .zm-direct[data-play-chat] .zm-dental .zm-direct-bubble:nth-child(4) { animation-delay: .54s; }
}

/* One continuous daylight scene. Keep the chair visible between the heading and the handset. */
[data-chat-concept="sunroom"] .zm-dental .zm-direct-scene {
  grid-template-columns: minmax(0,1fr) minmax(268px,.62fr);
  padding-block: 8px;
  background: linear-gradient(90deg,#fbf8f0 16%,#fbf8f0f7 34%,#fbf8f0bc 46%,#fbf8f01c 67%),
    url("images/clinic-pilots/chair-960.webp") center 55% / cover;
}
[data-chat-concept="sunroom"] .zm-dental { --ink: #29362f; --tint: #586f51; --angle: 4deg; }
#project-chat[data-chat-concept="sunroom"] .zm-dental h2 { max-width: none; }
[data-chat-concept="sunroom"] .zm-direct-device-wrap { justify-items: end; padding-block: 10px; }
[data-chat-concept="sunroom"] :is(.zm-direct-sheet, .zm-chat-compare) { max-width: 1080px; }
[data-chat-concept="sunroom"] [data-chat-caption] { position: relative; }
.sunroom-typing { position: absolute; inset: 0; opacity: 0; background: #416883; white-space: nowrap; }
[data-chat-concept="sunroom"] .zm-direct-account { min-height: 44px; padding-block: 0; }
.sunroom-play {
  flex: none; display: grid; place-items: center; margin-left: auto;
  width: 44px; height: 44px; padding: 0; background: transparent;
  border: 0; color: white; font: inherit; cursor: pointer; border-radius: 8px;
}
.sunroom-play > span { font: 20px/1 system-ui, sans-serif; }
.sunroom-play:hover { background: #ffffff18; }
.sunroom-play:focus-visible { outline: 2px solid white; outline-offset: -4px; }
@media (prefers-reduced-motion: no-preference) {
  [data-dialogue-play] { --dialogue-state: paused; }
  [data-dialogue-play][data-chat-in-view] { --dialogue-state: running; }
  [data-dialogue-play] .zm-direct-bubble {
    animation: zm-chat-arrives .25s ease-out var(--arrival, 0s) both var(--dialogue-state);
  }
  [data-dialogue-play] .zm-direct-bubble:nth-child(2) { --arrival: 1.65s; }
  [data-dialogue-play] .zm-direct-bubble:nth-child(3) { --arrival: 3s; }
  [data-dialogue-play] .zm-direct-bubble:nth-child(4) {
    --arrival: 4.65s;
    animation: zm-chat-arrives .25s ease-out var(--arrival) both var(--dialogue-state),
      sunroom-reply-accent 24s ease-in-out 20s 2 var(--dialogue-state);
  }
  [data-dialogue-play] .sunroom-typing { animation: sunroom-typing 4.65s linear both var(--dialogue-state); }
  @keyframes sunroom-typing {
    0%, 12%, 35%, 39%, 73%, 100% { opacity: 0; }
    16%, 31%, 78%, 97% { opacity: 1; }
  }
  @keyframes sunroom-reply-accent {
    0%, 7%, 100% { box-shadow: 0 1px 2px #35483c15; }
    3% { box-shadow: 0 0 0 2px #72a9be80, 0 2px 8px #41688324; }
  }
}

/* A page shared in Telegram, framed by the white edge of a printed photograph. */
[data-chat-concept="clinic-page"] .zm-dental .zm-direct-scene {
  grid-template-areas: "phone copy";
  grid-template-columns: minmax(260px,1fr) minmax(0,1fr);
  padding: 0; gap: 0; align-items: stretch; background: #fffdfa;
}
[data-chat-concept="clinic-page"] .zm-dental { --tint: #456179; --angle: -3deg; }
[data-chat-concept="clinic-page"] .zm-direct-device-wrap {
  grid-area: phone; padding: 25px 18px; isolation: isolate;
  background: linear-gradient(142deg,#eaf1f2,#dce7ed);
}
[data-chat-concept="clinic-page"] .zm-direct-device-wrap::after {
  content: ""; position: absolute; z-index: -1; top: 13%; left: 6%; width: 68%; height: 65%;
  border: 7px solid #fff; border-bottom-width: 16px; box-shadow: 0 8px 24px #23405223;
  background: url("images/clinic-pilots/chair-480.webp") 36% center / cover; transform: rotate(-9deg);
}
[data-chat-concept="clinic-page"] .zm-direct-device { width: min(100%,272px); margin-left: 15%; }
[data-chat-concept="clinic-page"] .zm-direct-copy { grid-area: copy; align-self: center; padding: var(--space); }
[data-chat-concept="clinic-page"] .zm-chat-unfurl { margin-block: 4px 2px; }
[data-chat-concept="clinic-page"] .zm-chat-unfurl img { width: 36px; height: 28px; }

/* The receptionist, the exchange, and the invitation share a single horizontal composition. */
[data-chat-concept="front-desk"] .zm-dental { --tint: #42766b; --angle: -2deg; }
[data-chat-concept="front-desk"] .zm-dental .zm-direct-scene {
  grid-template-columns: minmax(0,.72fr) minmax(250px,.8fr) minmax(0,1.15fr);
  grid-template-areas: "portrait phone copy"; padding: 18px var(--space) 18px 0;
  background: #f3f8f4; gap: clamp(10px,1.8vw,28px);
}
[data-chat-concept="front-desk"] .zm-direct-scene::before {
  content: ""; grid-area: 1 / 1 / 2 / 3; align-self: stretch; margin: -18px 42% -18px 0;
  background: url("images/partnership-review/a2-768.webp") 42% center / cover;
}
[data-chat-concept="front-desk"] .zm-direct-device-wrap { grid-area: phone; }
[data-chat-concept="front-desk"] .zm-direct-copy { grid-area: copy; }
[data-chat-concept="front-desk"] .zm-direct-copy .zm-direct-links { align-items: start; }

/* Editorial spread: headline and photograph, live-size conversation, invitation. */
[data-chat-concept="open-spread"] .zm-dental { --tint: #50647e; --angle: 2deg; }
[data-chat-concept="open-spread"] .zm-dental .zm-direct-scene {
  grid-template-columns: minmax(0,1fr) minmax(252px,.8fr) minmax(0,.85fr);
  grid-template-rows: 1fr 1fr; grid-template-areas: "title phone intro" "photo phone links";
  gap: 12px clamp(18px,2vw,32px); padding: 24px clamp(22px,3vw,46px);
  background: radial-gradient(ellipse at 49% 81%,#e1e7ef,transparent 42%),#fafbfb;
}
[data-chat-concept="open-spread"] .zm-direct-copy { display: contents; }
[data-chat-concept="open-spread"] h2 { grid-area: title; align-self: end; }
[data-chat-concept="open-spread"] .zm-direct-scene::before {
  content: ""; grid-area: photo; align-self: start; display: block;
  margin-top: 8px; aspect-ratio: 2.5; max-width: 260px; border-radius: 12px;
  background: url("images/clinic-pilots/chair-480.webp") 50% 60% / cover;
}
[data-chat-concept="open-spread"] .zm-direct-device-wrap { grid-area: phone; }
[data-chat-concept="open-spread"] .zm-direct-copy > p { grid-area: intro; margin: 0; align-self: end; }
[data-chat-concept="open-spread"] .zm-direct-links { grid-area: links; margin: 0; align-self: start; }

/* Settlement at the point of payment, with a short receipt line beneath the offer. */
[data-chat-concept="paid-visit"] .zm-dental { --tint: #775438; --angle: 3deg; }
[data-chat-concept="paid-visit"] .zm-dental .zm-direct-scene {
  padding: 0; gap: 0; align-items: stretch; grid-template-columns: minmax(0,1fr) minmax(260px,1fr);
  background: #fbf8f2;
}
[data-chat-concept="paid-visit"] .zm-direct-copy { align-self: center; padding: var(--space); }
[data-chat-concept="paid-visit"] .zm-direct-copy > p {
  margin-block: 18px 0; padding-block: 12px; border-block: 1px dashed #bead94;
}
[data-chat-concept="paid-visit"] .zm-direct-device-wrap {
  padding: 25px 18px; background: linear-gradient(110deg,#fff7e955,#fff7e91a),
    url("images/partnership-review/c3-768.webp") 48% center / cover;
}
@media (min-width: 741px) and (max-width: 1000px) {
  [data-chat-concept="front-desk"] .zm-dental .zm-direct-scene { grid-template-columns: minmax(65px,.3fr) 266px minmax(0,1fr); }
  [data-chat-concept="open-spread"] .zm-dental .zm-direct-scene {
    grid-template-columns: minmax(0,1fr) minmax(256px,.86fr);
    grid-template-areas: "photo phone" "title phone" "intro phone" "links phone";
    grid-template-rows: 1fr auto auto 1fr;
  }
  [data-chat-concept="open-spread"] .zm-direct-scene::before { align-self: end; width: 62%; }
}
@media (max-width: 740px) {
  .zm-chat-compare:has(a:nth-child(5)) { grid-template-columns: repeat(auto-fit,minmax(105px,1fr)); }
  .zm-chat-compare:has(a:nth-child(5)) a { text-align: center; }
  [data-chat-concept] .zm-dental .zm-direct-scene {
    display: flex; flex-direction: column; align-items: stretch; padding: 0; gap: 0;
  }
  #project-chat .zm-dental h2 { max-width: 19ch; font-size: clamp(30px,7.5vw,43px); }
  [data-chat-concept] .zm-dental .zm-direct-copy { display: block; padding: 22px 18px 12px; align-self: stretch; }
  .zm-dental .zm-direct-copy > p { margin-top: 9px; font-size: 16px; }
  [data-chat-concept] .zm-dental .zm-direct-copy .zm-direct-links { margin-top: 12px; }
  [data-chat-concept] .zm-dental .zm-direct-device-wrap { justify-items: center; padding: 15px 6px; }
  .zm-dental .zm-direct-device { width: min(calc(100% - 10px),252px); margin: 0; --angle: 2deg; }
  [data-chat-concept="sunroom"] .zm-dental .zm-direct-scene { background: #fcfaf3; }
  [data-chat-concept="sunroom"] .zm-dental .zm-direct-copy { padding-block: 16px 7px; }
  [data-chat-concept="sunroom"] .zm-direct-copy > p { margin-top: 7px; }
  [data-chat-concept="sunroom"] .zm-dental .zm-direct-copy .zm-direct-links { margin-top: 8px; }
  [data-chat-concept="sunroom"] .zm-dental .zm-direct-device-wrap { padding-block: 7px; }
  [data-chat-concept="sunroom"] .zm-direct-device-wrap {
    background: linear-gradient(#fcfaf3,transparent 20%),url("images/clinic-pilots/chair-480.webp") center / cover;
  }
  [data-chat-concept="open-spread"] .zm-direct-scene::before { display: none; }
  [data-chat-concept="front-desk"] .zm-direct-scene::before { display: none; }
  [data-chat-concept="front-desk"] .zm-dental .zm-direct-copy {
    display: grid; grid-template-columns: minmax(0,1fr) clamp(74px,24vw,104px);
    grid-template-areas: "title portrait" "text text" "actions actions"; column-gap: 10px; align-items: center;
  }
  [data-chat-concept="front-desk"] .zm-direct-copy::after {
    content: ""; grid-area: portrait; aspect-ratio: 1.28; border-radius: 12px;
    background: url("images/partnership-review/a2-480.webp") 44% 39% / cover;
  }
  [data-chat-concept="front-desk"] .zm-direct-copy h2 { grid-area: title; }
  [data-chat-concept="front-desk"] .zm-direct-copy p { grid-area: text; }
  [data-chat-concept="front-desk"] .zm-direct-copy .zm-direct-links { grid-area: actions; }
  [data-chat-concept="clinic-page"] .zm-dental .zm-direct-device { width: min(100%,269px); margin: 0; --angle: 1deg; }
  [data-chat-concept="paid-visit"] .zm-direct-device-wrap { background-image: linear-gradient(110deg,#fff7e955,#fff7e91a),url("images/partnership-review/c3-480.webp"); }
}

/* The handset illustrates the conversation; scrolling belongs to the page. */
[data-chat-concept="sunroom"] .zm-direct-screen {
  overflow: clip;
  overscroll-behavior: auto;
}

[data-phone-pose="window"] { --phone-width: 238px; --phone-tilt: 10deg; }
[data-phone-pose="center"] { --phone-width: 234px; --phone-tilt: -12deg; }
[data-phone-pose="left"] { --phone-width: 228px; --phone-tilt: 15deg; }
[data-chat-concept="sunroom"] [data-phone-pose] .zm-direct-device {
  width: min(100%,var(--phone-width));
  --angle: var(--phone-tilt);
}
[data-chat-concept="sunroom"] [data-phone-pose] .zm-direct-device-wrap {
  justify-items: center;
  padding-block: 18px;
}
[data-phone-pose] .zm-direct-screen { padding: 6px; gap: 5px; }
[data-phone-pose] .zm-direct-bubble {
  font-size: 13.5px; line-height: 1.29;
  padding: 5px 7px; max-width: 98%;
}
@media (min-width: 741px) {
  [data-chat-concept="sunroom"] [data-phone-pose] .zm-direct-scene {
    grid-template-columns: minmax(0,1fr) minmax(320px,.72fr);
    padding-inline: clamp(26px,4vw,54px);
  }
  [data-chat-concept="sunroom"] [data-phone-pose="center"] .zm-direct-scene {
    grid-template-columns: minmax(0,.88fr) minmax(320px,1.12fr);
    background-position: center, 52% 58%;
  }
  [data-chat-concept="sunroom"] [data-phone-pose="left"] .zm-direct-scene {
    grid-template-columns: minmax(330px,.83fr) minmax(0,1fr);
    grid-template-areas: "phone copy";
    background-image: linear-gradient(90deg,transparent 10%,#fbf8f04d 39%,#fbf8f0ee 59%,#fbf8f0 86%),
      url("images/clinic-pilots/chair-960.webp");
  }
  [data-phone-pose="left"] .zm-direct-copy { grid-area: copy; }
  [data-phone-pose="left"] .zm-direct-device-wrap { grid-area: phone; }
}
@media (max-width: 740px) {
  [data-chat-concept="sunroom"] [data-phone-pose] .zm-direct-device-wrap { padding-block: 23px; }
  [data-chat-concept="sunroom"] [data-phone-pose="center"] .zm-direct-device-wrap { background-position: center, 66% center; }
  [data-chat-concept="sunroom"] [data-phone-pose="left"] .zm-direct-device-wrap { background-position: center, 28% center; }
}
@media (max-width: 389px) {
  /* Leave room for the tilted corners while keeping the dialogue at reading size. */
  [data-phone-pose="window"] { --phone-tilt: 8deg; }
  [data-phone-pose="center"] { --phone-tilt: -9deg; }
  [data-phone-pose="left"] { --phone-tilt: 10deg; }
}
@media (max-width: 349px) {
  [data-phone-pose="window"] { --phone-tilt: 4deg; }
  [data-phone-pose="center"] { --phone-tilt: -5deg; }
  [data-phone-pose="left"] { --phone-tilt: 6deg; }
}

/* Carry the daylight from the partnership section into the cooler team section. */
#project-chat:has([data-phone-pose="window"]) {
  overflow: clip;
  background: linear-gradient(to bottom, #fff, #fafbf7 42%, #f1f5f6);
}
#project-chat [data-phone-pose="window"] {
  max-width: none;
  overflow: visible;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
#project-chat [data-phone-pose="window"] .zm-direct-scene {
  padding-inline: 0;
  background: transparent;
}
#project-chat [data-phone-pose="window"] .zm-direct-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
  padding-inline: 0;
}
#project-chat [data-phone-pose="window"] .zm-direct-device-wrap {
  isolation: isolate;
  background: transparent;
}
/* Fade only the photograph. The phone, text and controls stay fully opaque. */
[data-phone-pose="window"] .zm-direct-device-wrap::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: -5% max(-6vw, -88px) -5% -55%;
  background: url("images/clinic-pilots/chair-960.webp") center 56% / cover no-repeat;
  --photo-sides: linear-gradient(to right, transparent, #000 36%, #000 77%, transparent);
  --photo-ends: linear-gradient(to bottom, transparent, #000 19%, #000 76%, transparent);
  -webkit-mask-image: var(--photo-sides), var(--photo-ends);
  -webkit-mask-composite: source-in;
  mask-image: var(--photo-sides), var(--photo-ends);
  mask-composite: intersect;
}
@media (min-width: 741px) {
  #project-chat [data-phone-pose="window"] .zm-direct-scene {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  }
}
@media (min-width: 741px) and (max-width: 1000px) {
  [data-phone-pose="window"] .zm-direct-device-wrap::after {
    left: -18%;
  }
}
@media (max-width: 740px) {
  [data-phone-pose="window"] .zm-direct-device-wrap::after {
    inset: 0 max(-7vw, -32px);
    background-image: url("images/clinic-pilots/chair-480.webp");
    --photo-sides: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent);
  }
}
