/* KinBridge WhatsApp phone, mounted by kb-phone.js inside Lava's white "Currency Panel"
   (.framer-1554itz), replacing the currency grid. Framer breakpoints: >=1200 desktop,
   810-1199 tablet, <810 phone.

   Device: Mintpay's iPhone 15 Pro frame (PITSTOP vendor/mintpay, 601x1217, transparent
   screen at x 37-564, y 38-1180) drawn in a 240x486 box and scaled by --s, as PITSTOP's
   Coins phone. Rise-in, glow and easing are PITSTOP's.

   Screen: WhatsApp for iOS, light mode, sized from iOS points. The screen is 211.6px for
   393pt, so 1pt = 0.5385px: status bar 54pt, nav bar 44pt, avatar 36pt, body 17pt/22pt,
   time 11pt (WhatsApp meta grey #667781), bubbles white / #D9FDD3 on the #EFEAE2 chat background with our own doodle tile, bubble radius 15pt, tails on the LAST bubble of a run at the bottom corner
   (iOS), not the top (Android). Font: SF Pro (the system font on Apple devices, the PITSTOP
   SF Pro Display files elsewhere). The panel crops the phone so only its top shows. */

@font-face { font-family: "KB SF Pro"; font-weight: 400; font-display: swap; src: url("https://kinbridge.pages.dev/assets/SFProDisplay-400.otf") format("opentype"); }
@font-face { font-family: "KB SF Pro"; font-weight: 600; font-display: swap; src: url("https://kinbridge.pages.dev/assets/SFProDisplay-600.otf") format("opentype"); }

#currency .framer-1554itz { height: 620px !important; display: block !important;
  background: linear-gradient(180deg, #ffffff 0%, #fcf8ee 58%, #f6eacb 100%) !important; }   /* ivory depth (Ritual cream tones) */
#currency .framer-1554itz > :not(.kbp) { display: none !important; }
@media (min-width: 810px) and (max-width: 1199.98px) { #currency .framer-1554itz { height: 540px !important; } }
@media (max-width: 809.98px) { #currency .framer-1554itz { height: 460px !important; } }

.kbp {
  --s: 1.75;
  --top: 56px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}
@media (min-width: 810px) and (max-width: 1199.98px) { .kbp { --s: 1.5; --top: 52px; } }
@media (max-width: 809.98px) { .kbp { --s: 1.3; --top: 40px; } }

.kbp-phone {
  position: absolute; top: var(--top); left: 50%;
  width: 240px; height: 486px;
  margin-left: calc(-120px * var(--s));
  transform-origin: 0 0;
  opacity: 0;
  transform: translateY(40px) scale(var(--s));
  transition: opacity .8s ease, transform 1.1s var(--ease);
}
.kbp.is-in .kbp-phone { opacity: 1; transform: scale(var(--s)); }

.kbp-glow { display: none; }
.kbp-frame {
  position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%;
  pointer-events: none; user-select: none;
}

.kbp-screen {
  position: absolute; top: 14.6px; right: 13.8px; bottom: 13.8px; left: 13.8px;
  z-index: 1; overflow: hidden; border-radius: 30px;
  background: #fff; color: #0e1b16;
  font-family: -apple-system, BlinkMacSystemFont, "KB SF Pro", "Segoe UI", system-ui, sans-serif;
  font-size: 9.15px; line-height: 11.85px; letter-spacing: -.012em; text-align: left;
  -webkit-font-smoothing: antialiased;
}

/* status bar (54pt), in line with the Dynamic Island */
.kbp-bar {
  position: absolute; top: 0; right: 0; left: 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between;
  height: 31px; padding: 1px 21px 0 30px; box-sizing: border-box;
  font-size: 9.15px; font-weight: 600; letter-spacing: -.01em;
}
.kbp-bar svg { display: block; height: 6.2px; width: auto; }

/* nav bar (44pt), solid white like Lava's app screens */
.kbp-head {
  position: absolute; top: 0; right: 0; left: 0; z-index: 3;
  display: flex; align-items: center; gap: 5px;
  height: 57px; padding: 31px 9px 0 6px; box-sizing: border-box;
  background: #f6f6f6; box-shadow: 0 .5px 0 rgba(0, 0, 0, .12);
}
.kbp-back { width: 5.5px; height: 10px; flex: none; margin-right: 2px; }
.kbp-ava { display: grid; place-items: center; width: 19.4px; height: 19.4px; flex: none; border-radius: 50%; background: #142b6f; }
.kbp-ava svg { width: 13px; height: auto; }
.kbp-who { flex: 1; min-width: 0; padding-left: 1px; }
.kbp-who b, .kbp-who small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbp-who b { font-size: 9.15px; line-height: 11px; font-weight: 600; letter-spacing: -.02em; }
.kbp-who small { font-size: 6.5px; line-height: 8px; color: #9aa1a9; }
.kbp-icon { width: 12.5px; height: 12.5px; flex: none; margin-left: 8px; }

/* the chat */
.kbp-view {
  position: absolute; top: 57px; right: 0; bottom: 0; left: 0; padding: 0 9px;
  /* WhatsApp's light chat colour with a KinBridge doodle tile (tea cup, heart, leaf, pill, home, sun):
     the feel of WhatsApp's wallpaper without copying Meta's artwork */
  background: #efeae2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%237d6c55' stroke-opacity='.2' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 14l-4.4-4.3a2.7 2.7 0 0 1 4.4-3.2 2.7 2.7 0 0 1 4.4 3.2z'/%3E%3Cg transform='rotate(-35 55 12)'%3E%3Crect x='48' y='9' width='14' height='6' rx='3'/%3E%3Cpath d='M55 9v6'/%3E%3C/g%3E%3Cpath d='M27 47c0-8 6-12 14-12 0 8-6 12-14 12zM27 47l8-7'/%3E%3Cpath d='M58 45h10v4.5a5 5 0 0 1-10 0zM68 46.5h1.4a2 2 0 0 1 0 4H68M61 41.5c0-1.5 1.4-1.6 1.4-3.2M64.6 41.5c0-1.5 1.4-1.6 1.4-3.2'/%3E%3Cpath d='M5 67l7-6 7 6M7.2 65.4V72h9.6v-6.6'/%3E%3Ccircle cx='44' cy='69' r='2.4'/%3E%3Cpath d='M44 63.2v1.4M44 73.4v1.4M38.2 69h1.4M48.4 69h1.4M39.9 64.9l1 1M47.1 72.1l1 1M39.9 73.1l1-1M47.1 65.9l1-1'/%3E%3Ccircle cx='30' cy='15' r='.8'/%3E%3Ccircle cx='71' cy='29' r='.8'/%3E%3Ccircle cx='17' cy='37' r='.8'/%3E%3Ccircle cx='63' cy='72' r='.8'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 64px 64px repeat;
}
.kbp-list { display: flex; flex-direction: column; gap: 1.6px; padding-top: 7px; transition: transform .6s var(--ease), opacity .5s ease; }
.kbp-list.is-fading { opacity: 0; }

.kbp-day {
  align-self: center; margin-bottom: 5px; padding: 2.4px 6px; border-radius: 5px;
  background: #fff; color: #54656f; box-shadow: 0 .5px .6px rgba(11, 20, 26, .13);
  font-size: 6.2px; line-height: 8px; font-weight: 500; letter-spacing: .01em;
}

.kbp-msg {
  position: relative; align-self: flex-start; max-width: 76%; margin: 0;
  padding: 3.8px 6.4px 3.6px 7px; border-radius: 8px; background: #fff; color: #111b21;
  box-shadow: 0 .5px .6px rgba(11, 20, 26, .13);
  animation: kbpRise .6s var(--ease) both;
}
.kbp-msg + .kbp-day { margin-top: 7px; }
.kbp-static { animation: none; }
.kbp-out { align-self: flex-end; max-width: 80%; background: #d9fdd3; margin-top: 4.8px; }

/* iOS tail: on the run's last bubble, curling out of the bottom corner */
.kbp-tail { margin-bottom: 3.2px; border-bottom-left-radius: 1.5px; }
.kbp-tail::after {
  content: ""; position: absolute; bottom: 0; left: -5.4px; width: 6px; height: 8.5px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 7'%3E%3Cpath d='M5 0C5 3.6 3.4 6 0 7h5z' fill='%23ffffff'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
}
.kbp-out.kbp-tail { border-bottom-left-radius: 8px; border-bottom-right-radius: 1.5px; }
.kbp-out.kbp-tail::after {
  left: auto; right: -5.4px; transform: scaleX(-1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 7'%3E%3Cpath d='M5 0C5 3.6 3.4 6 0 7h5z' fill='%23d9fdd3'/%3E%3C/svg%3E");
}

/* time (11pt) and ticks at the bubble's bottom right */
.kbp-meta {
  float: right; display: inline-flex; align-items: center; gap: 1.6px;
  margin: 4.6px -1.2px -2.6px 7px; font-size: 5.6px; line-height: 7px; color: #667781;
  letter-spacing: 0; white-space: nowrap;
}
.kbp-out .kbp-meta { color: #667781; }
.kbp-ticks { width: 8.6px; height: 6px; color: #8696a0; transition: color .4s ease; }
.kbp-ticks.is-read { color: #53bdeb; }

.kbp-photo { padding: 1.6px; border-radius: 9px; overflow: hidden; background: #fff; }
.kbp-photo.kbp-tail { margin-bottom: 0; border-bottom-left-radius: 9px; }
.kbp-photo::after { display: none; }
.kbp-photo img { display: block; width: 136px; height: 102px; object-fit: cover; border-radius: 7.5px; }
.kbp-photo .kbp-meta {
  position: absolute; right: 0; bottom: 0; float: none; margin: 0;
  padding: 8px 6px 3.6px 14px;
  background: radial-gradient(80% 100% at 100% 100%, rgba(0, 0, 0, .38), transparent);
  color: #fff;
}

.kbp-typing { display: flex; gap: 2.4px; padding: 6px 8px; }
.kbp-typing i { width: 3.6px; height: 3.6px; border-radius: 50%; background: #8696a0; animation: kbpDot 1.2s ease-in-out infinite; }
.kbp-typing i:nth-child(2) { animation-delay: .15s; }
.kbp-typing i:nth-child(3) { animation-delay: .3s; }

@keyframes kbpRise { from { opacity: 0; transform: translateY(8px); } }
@keyframes kbpDot { 0%, 60%, 100% { opacity: .4; transform: none; } 30% { opacity: 1; transform: translateY(-1.5px); } }

@media (prefers-reduced-motion: reduce) {
  .kbp-phone, .kbp-list, .kbp-msg, .kbp-glow { transition: none !important; animation: none !important; }
}
