/* Try it (ktry.js): a button on the phone on wide screens; a floating button
   and a full-screen sheet on phones. */

/* ---- each page tells its story without its phone ---- */
html.kp-narrow .ks.kpage:not(#top) .phone:has(> .kapp-slot),
html.kp-narrow .ks .or-phone, html.kp-narrow .ks .cu-phone, html.kp-narrow .ks .db-phone,
html.kp-narrow .ks .pd-phone, html.kp-narrow .ks .st-phone, html.kp-narrow .ks .sd-phone,
html.kp-narrow .ks .pp-live, html.kp-narrow .ks .cf-phone, html.kp-narrow .ks .of-phone,
html.kp-narrow .ks .tm-phone, html.kp-narrow .ks .ln-phone { display: none !important; }
/* the hero's small phone shows the app without taking touches; a tap opens the sheet */
html.kp-narrow .ks #top .kapp-slot, html.kp-narrow .ks.kpage#top .kapp-slot { --kapp-touch: none; cursor: pointer; }

/* ---- wide screens: the button on the phone's bottom edge ---- */
.ks.ktry-dock {
  position: absolute; left: 0; top: 0; z-index: 45;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 14px 0 5px; border: 0; border-radius: 24px;
  background: #0F1D22; color: #fff; font: 800 15px/1.2 var(--font); white-space: nowrap;
  box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 10px 26px rgba(6,20,28,.3);
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
.ks.ktry-dock.on { opacity: 1; visibility: visible; transition: opacity .3s ease, visibility 0s, background .2s; }
.ks.ktry-dock:hover { background: #1B2F37; }
.ks.ktry-dock .ktry-ic { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--c500); color: #04242B; }
.ks.ktry-dock .ktry-ic svg { width: 19px; height: 19px; }
.ks.ktry-dock .ktry-go { width: 17px; height: 17px; flex: none; opacity: .7; }
.ks.ktry-dock[dir="rtl"] .ktry-go { transform: scaleX(-1); }
/* while the app is the visitor's: a quieter way back to the example */
.ks.ktry-dock.again { min-height: 40px; padding: 0 16px 0 6px; background: #fff; color: #0F1D22; font-size: 14px; box-shadow: 0 0 0 1px rgba(15,29,34,.12), 0 8px 20px rgba(6,20,28,.22); }
.ks.ktry-dock.again:hover { background: #F2F5F8; }
.ks.ktry-dock.again .ktry-ic { width: 30px; height: 30px; background: transparent; color: #0F1D22; }

/* ---- phones: the floating Try it button ---- */
.ks.ktry-pill {
  position: fixed; z-index: 60; left: 50%; bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px));
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; max-width: calc(100vw - 32px); padding: 0 14px 0 6px; border: 0; border-radius: 26px;
  background: #0F1D22; color: #fff;
  font: 800 16px/1.2 var(--font); white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 10px 26px rgba(6,20,28,.34), 0 2px 6px rgba(6,20,28,.2);
  transform: translate(-50%, calc(100% + 40px)); opacity: 0; visibility: hidden;
  transition: transform .42s var(--ease), opacity .3s ease, visibility 0s linear .42s;
  -webkit-tap-highlight-color: transparent;
}
.ks.ktry-pill.on { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .5s var(--spring), opacity .3s ease, visibility 0s; }
.ks.ktry-pill:active { transform: translate(-50%, 0) scale(.97); }
.ks.ktry-pill .ktry-ic { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--c500); color: #04242B; }
.ks.ktry-pill .ktry-ic svg { width: 20px; height: 20px; }
.ks.ktry-pill .ktry-l { min-width: 0; }
.ks.ktry-pill .ktry-go { width: 18px; height: 18px; flex: none; opacity: .7; }
.ks.ktry-pill[dir="rtl"] .ktry-go { transform: scaleX(-1); }
.ks.ktry-pill.nudge .ktry-ic { animation: ktry-nudge .9s var(--ease); }
@keyframes ktry-nudge { 0% { box-shadow: 0 0 0 0 rgba(11,186,216,.6) } 100% { box-shadow: 0 0 0 14px rgba(11,186,216,0) } }

/* ---- the sheet ---- */
html.ktry-lock, html.ktry-lock body { overflow: hidden; overscroll-behavior: none; scroll-snap-type: none; }
.ks.ktry-sheet { position: fixed; inset: 0; z-index: 1000; touch-action: none; }
.ks.ktry-sheet .ktry-scrim { position: absolute; inset: 0; background: rgba(4,14,20,.55); opacity: 0; transition: opacity .35s ease; }
.ks.ktry-sheet .ktry-panel {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) max(12px, env(safe-area-inset-bottom)) env(safe-area-inset-left);
  background: radial-gradient(120% 60% at 50% 100%, rgba(11,186,216,.22), rgba(11,186,216,0) 70%), #06141C;
  color: #fff;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,1,1);
  will-change: transform;
}
.ks.ktry-sheet.on .ktry-scrim { opacity: 1; }
.ks.ktry-sheet.on .ktry-panel { transform: none; transition: transform .5s cubic-bezier(.2,.85,.25,1); }
.ks.ktry-sheet .ktry-head { flex: none; display: flex; align-items: center; gap: 8px; min-height: 64px; padding-inline: 20px 6px; }
.ks.ktry-sheet .ktry-titles { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ks.ktry-sheet .ktry-title { font-size: 18px; font-weight: 800; line-height: 1.25; }
.ks.ktry-sheet .ktry-sub { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; line-height: 1.35; color: #9FB6BF; }
.ks.ktry-sheet .ktry-sub i { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--c500); }
.ks.ktry-sheet.waiting .ktry-sub i { animation: k-blink 1.1s ease-in-out infinite; }
.ks.ktry-sheet .ktry-x {
  flex: none; width: 48px; height: 48px; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: transparent; color: #C9DCE2; -webkit-tap-highlight-color: transparent;
}
.ks.ktry-sheet .ktry-x svg { width: 22px; height: 22px; }
.ks.ktry-sheet .ktry-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 4px 12px 0; container-type: size; }
.ks.ktry-sheet .ktry-slot {
  /* kapp.js lays the live app over this, above the sheet */
  --kapp-z: 1001;
  width: min(100cqw, 100cqh * 390 / 844); aspect-ratio: 390 / 844; height: auto;
  border-radius: 30px; background: #F4FAFB;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 24px 60px rgba(0,0,0,.45);
}
@media (prefers-reduced-motion: reduce) {
  .ks.ktry-pill, .ks.ktry-pill.on, .ks.ktry-sheet .ktry-panel, .ks.ktry-sheet.on .ktry-panel { transition: none; }
}
