/* Team (agent A, round 3): Yaseen minds the shop, Abu Ali is out buying stock at Ammar's.
   A bigger discount needs Abu Ali's OK: the request crosses, he allows it, the sale is done.
   One side is in focus at a time; the other rests in shade. */
.team { --mark: #FAD7A0; }
.team .tm-bg { background: linear-gradient(90deg, #F8E7CF 0%, #F8E7CF 50%, #DCE6EA 50%, #DCE6EA 100%); }
.team[dir="rtl"] .tm-bg { background: linear-gradient(270deg, #F8E7CF 0%, #F8E7CF 50%, #DCE6EA 50%, #DCE6EA 100%); }
.team .tm-view { position: absolute; inset: 0; pointer-events: none; }
.team .tm-stage { position: absolute; left: 0; top: 0; width: 1440px; height: 900px; }
.team .tm-scene { position: absolute; left: 0; top: 0; width: 1440px; height: 900px; transform-origin: 720px 0; pointer-events: none; }
.team[dir="rtl"] .tm-scene { transform: scaleX(-1); }
.team .tm-art, .team .tm-counter, .team .tm-shades, .team .tm-link { position: absolute; left: 0; top: 0; overflow: visible; }
.team .tm-fig { position: absolute; }
.team .tm-fig > svg { display: block; overflow: visible; }
.team .tm-yaseen { left: 350px; top: 571px; }
.team .tm-cust { left: 146px; top: 571px; }
.team .tm-abuali { left: 650px; top: 549px; }
.team .tm-karim { left: 805px; top: 549px; }
.team .kc .fing { opacity: 0 !important; }
.team .tm-cpar { transition: opacity .15s; }
.team.s-d0 .tm-cpar, .team.s-d1 .tm-cpar, .team.s-end .tm-cpar { opacity: 0; }

/* light and shade */
.team .tm-shades rect { fill: #1C2A33; opacity: 0; transition: opacity .7s var(--ease); }
.team.s-a0 .tm-sh-wh, .team.s-a1 .tm-sh-wh, .team.s-r0 .tm-sh-wh { opacity: .3; }
.team.s-r1 .tm-sh-shop { opacity: .2; }
.team[class*=" s-l"] .tm-sh-shop { opacity: .3; }
.team.s-d0 .tm-sh-wh { opacity: .2; }
.team .tm-link { opacity: 0; transition: opacity .5s var(--ease); }
.team[class*=" s-l"] .tm-link { opacity: 1; }

/* what the customer asks, and the request that crosses over */
.team .tm-notes { position: absolute; inset: 0; pointer-events: none; }
.team .tm-say { position: absolute; inset-inline-start: 64px; top: 468px; max-width: 250px; margin: 0; padding: 11px 15px; border-radius: 16px; border-end-start-radius: 4px;
  background: #FFFFFF; color: var(--ink); font-size: 16px; font-weight: 700; line-height: 1.35; box-shadow: var(--shadow-2);
  opacity: 0; transform: translateY(8px) scale(.96); transform-origin: 30% 100%; transition: opacity .35s var(--ease), transform .45s var(--spring); }
.team .tm-say.on { opacity: 1; transform: none; }
.team .tm-card { position: absolute; left: 0; top: 0; width: 230px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: #FFFFFF; box-shadow: var(--shadow-2);
  transform-origin: 30% 50%; transition: transform 1.1s cubic-bezier(.5,.05,.2,1), opacity .3s var(--ease); }
.team .tm-card.fresh { transition-duration: .3s; }
.team .tm-cic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--warn-50); color: var(--warn); transition: background .3s, color .3s; }
.team .tm-cic svg { width: 18px; height: 18px; }
.team .tm-ct { display: grid; line-height: 1.25; }
.team .tm-ct b { font-size: 15px; font-weight: 800; }
.team .tm-ct small { grid-area: 2 / 1; font-size: 13px; font-weight: 700; transition: opacity .25s; }
.team .tm-ask { color: var(--warn-800); }
.team .tm-ok { color: var(--ok); display: inline-flex; align-items: center; gap: 4px; opacity: 0; }
.team .tm-ok svg { width: 14px; height: 14px; }
.team .tm-card.ok .tm-ask { opacity: 0; }
.team .tm-card.ok .tm-ok { opacity: 1; transition-delay: .22s; }
.team .tm-card.ok .tm-cic { background: var(--ok-50); color: var(--ok); }

/* ---------- copy over the shop ---------- */
.team .tm-copy { position: absolute; inset-inline-start: 96px; top: 100px; width: 560px; }
.team .tm-copy .eyebrow img { width: 30px; height: 30px; border-radius: 9px; background: #fff; padding: 5px; box-shadow: var(--shadow-1); }
.team .tm-pro { font-size: 13px; font-weight: 800; color: #9A6B0C; }
.team .tm-pro::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-inline-end: 9px; vertical-align: middle; opacity: .6; }
.team .tm-copy .h2 { font-size: 52px; }
.team .tm-copy .lead { margin-top: 14px; font-size: 17px; max-width: 31em; }
.team .tm-facts { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.team .tm-facts li { position: relative; padding-inline-start: 16px; font-size: 14px; font-weight: 700; line-height: 1.4; }
.team .tm-facts li::before { content: ""; position: absolute; inset-inline-start: 0; top: .45em; width: 8px; height: 8px; border-radius: 2px; background: var(--c500); }
/* the steps run along the floor, across both places */
.team .tm-beats { position: fixed; }
.team .tm-copy .tm-beats { position: absolute; top: 762px; inset-inline-start: 0; width: 1100px; }
.team .tm-beats .beats { gap: 4px 30px; }
.team .tm-beats .beats li { font-size: 15px; }

/* ---------- the live phone: Abu Ali's ---------- */
.team .tm-phone { position: absolute; inset-inline-end: 56px; top: 98px; }
.team .tm-phone .phone { --pz: .8; }
.team[lang="ar"] .tm-p-en, .team:not([lang="ar"]) .tm-p-ar { display: none; }

/* ---------- narrow ---------- */
html.kp-narrow .team .kframe { display: flex; flex-direction: column; padding: 88px 0 40px; }
html.kp-narrow .team .tm-bg { background: #F8E7CF; }
html.kp-narrow .team .tm-copy { position: static; width: auto; padding: 0 20px; order: 1; }
html.kp-narrow .team .tm-copy .h2 { font-size: 38px; }
html.kp-narrow .team .tm-copy .tm-beats { position: static; width: auto; margin-top: 18px; }
html.kp-narrow .team .tm-view { position: relative; inset: auto; order: 2; width: 700px; height: 470px; overflow: hidden; margin: 18px auto 0; zoom: .54; }
html.kp-narrow .team .tm-stage { left: -30px; top: -430px; }
html.kp-narrow .team[dir="rtl"] .tm-stage { left: -710px; }
@media (min-width: 420px) { html.kp-narrow .team .tm-view { zoom: .6; } }
html.kp-narrow .team .tm-phone { position: static; order: 3; display: flex; justify-content: center; margin-top: 22px; }
html.kp-narrow .team .tm-phone .phone { --pz: .7; }

/* ---------- phones (round 5): the view follows the request. It starts on the
   shop at home, pans to Noor at Hajji Karim's while Yaseen asks and she allows,
   and comes back for the handover. Noor's phone opens from the Try it button. ---------- */
html.kp-narrow .team .tm-stage { transition: left 1.1s cubic-bezier(.45,0,.2,1); }
html.kp-narrow .team.s-r1 .tm-stage, html.kp-narrow .team.s-l0 .tm-stage,
html.kp-narrow .team.s-l1 .tm-stage, html.kp-narrow .team.s-l2 .tm-stage { left: -380px; }
html.kp-narrow .team[dir="rtl"].s-r1 .tm-stage, html.kp-narrow .team[dir="rtl"].s-l0 .tm-stage,
html.kp-narrow .team[dir="rtl"].s-l1 .tm-stage, html.kp-narrow .team[dir="rtl"].s-l2 .tm-stage { left: -360px; }

@media (prefers-reduced-motion: reduce) { html.kp-narrow .team .tm-stage { transition: none; } }

/* small phones (round 5): the drawing fits the screen width, nothing cut at the edge */
@media (max-width: 389px) { html.kp-narrow .team .tm-view { zoom: 0.514; } }
@media (max-width: 359px) { html.kp-narrow .team .tm-view { zoom: 0.457; } }

/* the step captions stay inside the shop half (they ran into the warehouse panel) */
html.kp-wide .ks.team .tm-copy .tm-beats { width: max-content; top: 750px; padding: 10px 18px 4px; border-radius: 16px; background: rgba(250,238,220,.96); box-shadow: 0 8px 24px -14px rgba(15,29,34,.35); }

/* phones, told full screen (kphone-story.js, story/team.js): the whole 1440 x 900 scene,
   moved by the story's camera; the old phone crop and its pan are undone */
html.kp-narrow .team[data-kst] .tm-bg { background: #F8E7CF; }
html.kp-narrow .team[data-kst] .tm-stage,
html.kp-narrow .team[dir="rtl"][data-kst] .tm-stage { left: 0 !important; top: 0; transition: none; }
html.kp-narrow .team[data-kst].s-ph-y1 .tm-sh-wh { opacity: .3; }
/* the scene is drawn smaller than on a wide screen, so its words grow back */
html.kp-narrow .team[data-kst] .tm-say { inset-inline-start: 170px; font-size: 21px; max-width: 260px; padding: 12px 17px; }
html.kp-narrow .team[data-kst] .tm-ct b { font-size: 19px; }
html.kp-narrow .team[data-kst] .tm-ct small { font-size: 16px; }
html.kp-narrow .team[data-kst] .tm-cic { width: 40px; height: 40px; }
html.kp-narrow .team[data-kst] .tm-cic svg { width: 21px; height: 21px; }
/* at home the camera fills the screen with the shop (HOME in story/team.js), so the
   answer that reaches Yaseen settles over the shelf between the two of them */
html.kp-narrow .team[data-kst] .tm-card { transition: transform 1.1s cubic-bezier(.5,.05,.2,1), opacity .3s var(--ease), translate .9s cubic-bezier(.3,.7,.2,1); }
html.kp-narrow .team[data-kst].s-ph-y1 .tm-card { translate: -60px -130px; }
html.kp-narrow .team[dir="rtl"][data-kst].s-ph-y1 .tm-card { translate: 60px -130px; }
/* the dotted line from Noor's phone to the live phone beside the drawing belongs to the wide page:
   in the phone story there is no phone beside the drawing (hers grows out of her hand) */
html.kp-narrow .team[data-kst] .tm-link { display: none; }
