@font-face {
  font-family: AndroidSymbols;
  src: url('../assets/NotoSansSymbols-Regular-Subsetted.ttf');
  font-display: block;
}

@font-face {
  font-family: AndroidSymbols2;
  src: url('../assets/NotoSansSymbols-Regular-Subsetted2.ttf');
  font-display: block;
}

@font-face {
  font-family: AndroidEmoji;
  src: url('../assets/NotoColorEmoji.ttf');
  font-display: block;
}

@font-face { font-family: AndroidRoboto; src: url('../assets/Roboto.ttf'); font-weight: 100 900; font-display: block; }

:root {
  color-scheme: light;
  font-family: AndroidRoboto, AndroidSymbols, AndroidSymbols2, AndroidEmoji, sans-serif;
  --blue: #007aff;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --status: var(--safe-top);
  --navigation: var(--safe-bottom);
  --device-corner: 41px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

body {
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
}

button, input, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

#screen {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: clip;
  isolation: isolate;
  background: #000;
  border-radius: var(--device-corner);
  touch-action: auto;
  --footer-height: 0px;
}

#main-mask {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: clip;
  background: #fff;
  border-radius: var(--device-corner);
  transform-origin: top center;
}

#chat-list {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

#chat-list-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

#chat-list-scroll::-webkit-scrollbar { display: none; }

.chat-scroll-content { position: relative; }

.chat-list-viewport { position: sticky; top: 0; width: 100%; }

.hit-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hit-layer button {
  position: absolute;
  pointer-events: auto;
  touch-action: pan-y;
  border: 0;
  background: transparent;
  padding: 0;
}

#windows {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

#moving-app-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 103px;
  background: #000;
  color: #fff;
  border-radius: var(--device-corner) var(--device-corner) 0 0;
  pointer-events: none;
}

.moving-app-identity {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  height: 28px;
  max-width: calc(100% - 120px);
  white-space: nowrap;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .15px;
}

.moving-app-identity .avatar {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
}

.moving-app-identity .title {
  margin-left: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.moving-app-identity .verified {
  width: 16px;
  height: 16px;
  margin-left: 4px;
  flex: none;
}

.app-window {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #fff;
  pointer-events: auto;
  transform-origin: bottom;
  will-change: transform;
}

.app-window iframe {
  border: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: inherit;
}

.app-window.inactive {
  visibility: hidden;
  pointer-events: none;
}

.app-header {
  position: absolute;
  top: var(--status);
  left: 0;
  right: 0;
  height: 56px;
  z-index: 4;
  touch-action: none;
}

.app-header button {
  border: 0;
  padding: 0;
  color: #060708;
}

.capsule {
  position: absolute;
  top: 4px;
  height: 40px;
  border-radius: 20px;
  background: transparent;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.capsule-surface {
  position: absolute;
  top: 4px;
  height: 40px;
  border-radius: 999px;
  background: rgba(250,250,250,.95);
  border: 0;


  box-shadow: 0 0 20px rgba(32,54,110,.14);
  pointer-events: none;
}

.capsule-surface::after {
  content: '';
  position: absolute;
  inset: -.5px;
  padding: 1px;
  border-radius: inherit;
  background: var(--header-stroke,rgba(255,255,255,.8));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.surface-left {
  left: 16px;
  width: 40px;
}

.surface-right {
  right: 16px;
  width: 80px;
}

.capsule-left {
  left: 16px;
  min-width: 40px;
  max-width: calc(100% - 128px);
}

.capsule-right {
  right: 16px;
  width: 80px;
  justify-content: center;
  gap: 12px;
}

.header-primary {
  width: 40px;
  min-width: 40px;
  height: 40px;
  background: transparent;
  display: grid;
  place-items: center;
}

.header-primary img {
  width: 24px;
  height: 24px;
}

.header-title {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .15px;
  line-height: 20px;
  padding-right: 10px;
}

.title-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-title .verified {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-left: 4px;
}

.capsule-right .icon-button {
  width: 24px;
  height: 40px;
}

.icon-button {
  border: 0;
  padding: 0;
  background: transparent;
  display: grid;
  place-items: center;
}

.icon-button img {
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.header-dots {
  position: absolute;
  left: calc(50% - 15px);
  top: 18px;
  width: 30px;
  height: 12px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.header-dots i {
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
}

.app-header.dark .capsule-surface {
  background: rgba(62,62,70,.95);
  color: #fff;
}

.app-header.dark button {
  color: #fff;
}

.app-header.dark .capsule img:not(.verified) {
  filter: invert(1);
}

.sheet-handle {
  display: none;
  width: 20px;
  height: 4px;
  border-radius: 2px;
  position: absolute;
  left: calc(50% - 10px);
  top: -46px;
  background: #b7b7b7;
}

.app-window.sheet {
  border-radius: 40px 40px var(--device-corner) var(--device-corner);
  box-shadow: 0 -6px 24px #0002;
}

.app-window.sheet .app-header {
  top: 16px;
}

.app-window.sheet .sheet-handle {
  display: block;
  top: -10px;
}

.app-window.sheet .capsule-left {
  padding: 0 10px;
  min-width: 0;
}

.app-window.sheet .header-primary {
  display: none;
}

.app-window.sheet .header-title {
  padding-right: 0;
}

.app-window.sheet .capsule-right {
  width: 40px;
}

.app-window.sheet .surface-right {
  width: 40px;
}

.app-window.sheet .header-close {
  display: none;
}

#sheet-scrim {
  position: absolute;
  inset: 0;
  background: #0c0d0e52;
  z-index: 1;
}

.loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: inherit;
  z-index: 2;
  transition: opacity 320ms cubic-bezier(.2,0,0,1);
}

.loader svg {
  width: 176px;
  height: 176px;
  opacity: .1;
}

#footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(72px + var(--navigation));
  background: #000;
  z-index: 20;
  color: #fff;
  touch-action: pan-x;
  border-radius: 0;
}

.footer-handle {
  position: absolute;
  left: calc(50% - 10px);
  top: 6px;
  width: 20px;
  height: 4px;
  border-radius: 2px;
  background: #5e5e5e;
}

#footer-tabs {
  position: absolute;
  top: 12px;
  bottom: 0;
  left: 0;
  right: 54px;
  display: flex;
  gap: 10px;
  overflow: hidden;
  align-items: flex-start;
  padding: 8px 20px 0;
}

.footer-tab {
  position: relative;
  flex: none;
  height: 36px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff;
  display: flex;
  gap: 6px;
  align-items: center;
  user-select: none;
  touch-action: pan-x;
}

.footer-tab .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.footer-tab.active .avatar {
  transform: scale(.88);
}

.footer-tab.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff29;
  opacity: var(--avatar-fill-alpha, 1);
}

#footer.single .footer-tab.active::before {
  display: none;
}

.footer-active-indicator {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  bottom: -9px;
  left: 16px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
}

.footer-tab .activity {
  max-width: 84px;
  border-radius: 18px;
  padding: 9px 12px;
  overflow: hidden;
  font-size: 15px;
  line-height: 18px;
  letter-spacing: .14px;
  background: #ffffff29;
  white-space: nowrap;
}

.marquee {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(to right,#000 calc(100% - 8px),transparent);
  mask-image: linear-gradient(to right,#000 calc(100% - 8px),transparent);
}

.marquee span {
  display: inline-block;
}

#footer-close {
  position: absolute;
  top: 16px;
  right: 10px;
  width: 44px;
  height: 44px;
}

#footer.single #footer-tabs {
  left: 52px;
  right: 52px;
  padding: 0;
  justify-content: center;
  top: 24px;
}

#footer.single .footer-tab {
  gap: 8px;
  height: 28px;
  max-width: 100%;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .1px;
}

#footer.single .avatar {
  width: 28px;
  height: 28px;
  transform: none;
}

#footer.single .single-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#footer.single .footer-up {
  position: absolute;
  left: 16px;
  top: 26px;
  width: 24px;
  height: 24px;
}

#footer.single .verified {
  width: 16px;
  height: 16px;
}

#overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

#footer-reveal {
  position: absolute;
  z-index: 35;
  bottom: var(--navigation);
  left: 0;
  width: 100%;
  height: 24px;
  border: 0;
  padding: 0;
  background: transparent;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

.context-menu {
  position: absolute;
  width: 256px;
  border-radius: 34px;
  padding: 10px;
  background: rgba(250,250,250,.95);
  border: 1px solid #fffc;


  box-shadow: 0 0 20px #20366e24;
  transform-origin: top right;
}

.context-menu.dark {
  background: rgba(62,62,70,.95);
  border-color: #ffffff33;
  color: #fff;
}

.context-menu button {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  padding: 0 10px;
  color: inherit;
  text-align: left;
  font-size: 16px;
  letter-spacing: .15px;
  position: relative;
  z-index: 1;
}

.menu-highlight {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 44px;
  border-radius: 24px;
  background: #20366e1a;
  opacity: 0;
  pointer-events: none;
}

.context-menu img {
  width: 24px;
  height: 24px;
  order: -1;
  margin-right: 12px;
}

.menu-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;


}

.context-menu.dark img {
  filter: invert(1);
}

.close-all-overlay {
  background: #0c0d0e52;
}

.close-all-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(268px + var(--navigation));
  padding: 24px 20px 0;
  background: #fff;
  border-radius: 32px 32px 0 0;
  text-align: left;
}

.confirmation-handle {
  position: absolute;
  top: 6px;
  left: calc(50% - 10px);
  width: 20px;
  height: 4px;
  border-radius: 4px;
  background: #06070847;
}

.close-all-sheet h2 {
  margin: 0 -4px;
  font-size: 24px;
  line-height: 28px;
  font-weight: 700;
  color: #060708;
}

.close-all-sheet button {
  position: absolute;
  left: 20px;
  right: 20px;
  width: calc(100% - 40px);
  border: 0;
  border-radius: 20px;
  height: 60px;
  font-size: 17px;
  letter-spacing: .15px;
  font-weight: 500;
  top: 176px;
  background: #20366e1a;
  color: #060708;
}

.close-all-sheet .destructive {
  top: 104px;
  background: #007aff;
  color: #fff;
}

#bot-chat {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: url('../miniapps/debug/backgrounds/miniapp_bg_01.png') center/cover;
}

.bot-messages {
  touch-action: pan-x pan-y;
  z-index: 1;
  -webkit-overflow-scrolling: touch;
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 130px 0 174px;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding-bottom: 168px;
}

.bot-timeline {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 0 6.7799px;
}

.bot-date {
  align-self: center;
  color: #fff;
  background: #0f8ec285;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  padding: 0 6px;
  margin: 12px 0 8px;
  box-sizing: content-box;
  height: 20px;
  line-height: 20px;
  letter-spacing: -.15px;
}

.bubble {
  position: relative;
  max-width: min(291px,calc(100% - 22px));
  padding: 0;
  font-size: 17px;
  line-height: 22px;
  letter-spacing: -.43px;
  background: #fff;
  border-radius: 16px;
  color: #0c0d0e;
  flex: none;
  min-height: 40px;
  margin-bottom: 6px;
  border-bottom-left-radius: 10px;
  user-select: none;
}

.bubble.outgoing {
  align-self: flex-end;
  background: #e9fdff;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 10px;
  margin-bottom: 8px;
}

.bubble time {
  float: none;
  margin: 0;
  color: #0c0d0e85;
  font-size: 11px;
  letter-spacing: .06px;
  line-height: 13px;
  position: absolute;
  right: 10px;
  bottom: 4px;
}

.bubble.outgoing time {
  color: #0f8ec2;
  right: 26px;
  bottom: 3px;
}

.bubble time img {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-left: 3px;
  position: absolute;
  right: -19px;
  top: -2px;
  margin: 0;
}

.rich-bubble {
  width: 296px;
  max-width: calc(100% - 12px);
  padding: 8px 0 6px;
  margin-bottom: 0;
}

.rich-prompt {
  padding: 0;
  margin-bottom: 12px;
  position: absolute;
  top: 8px;
  left: 10px;
  margin: 0;
}

.product-carousel {
  display: flex;
  gap: 8px;
  padding: 0 10px 0 0;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  position: absolute;
  left: 10px;
  right: 0;
  align-items: flex-start;
}

.product-card {
  scroll-snap-align: start;
  width: 248px;
  flex: none;
  overflow: hidden;
  border-radius: 10px;
  background: #ebf6fa;
  font-size: 14px;
  line-height: 18px;
  letter-spacing: .15px;
  scroll-snap-align: start;
  position: relative;
}

.product-card>img {
  display: block;
  width: 232px;
  max-height: 240px;
  height: auto;
  object-fit: cover;
  margin: 0;
  border-radius: 4px;
  position: absolute;
  left: 8px;
  top: 8px;
}

.product-card h3 {
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
  margin: 8px;
}

.product-card p {
  font-size: 14px;
  line-height: 18px;
  margin: 8px;
  color: #06070885;
}

.card-prices {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  position: absolute;
  left: 8px;
  height: 18px;
  line-height: 18px;
}

.card-prices del {
  font-weight: 400;
  color: #06070866;
}

.card-prices b {
  font-size: 11px;
  color: #ff303c;
  background: #ff303c29;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 0 4px;
  border-radius: 9px;
  line-height: 18px;
}

.product-card button {
  width: 100%;
  background: transparent;
  color: #0784b8;
  border: 0;
  border-top: 1px solid #0f8ec214;
  height: 40px;
  font-size: 16px;
  font-weight: 500;
  position: absolute;
  left: 0;
  line-height: 40px;
  padding: 0;
}

.bot-header {
  position: absolute;
  z-index: 3;
  top: calc(var(--status) + 10px);
  left: 16px;
  right: 16px;
  height: 56px;
  border-radius: 28px;
  background: #fafafaf2;
  border: 1px solid #fffc;


  display: flex;
  align-items: center;
  box-shadow: 0 0 20px #20366e24;
}

.bot-header .back {
  width: 48px;
  height: 56px;
}

.bot-header .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 10px;
  margin-left: -1px;
}

.bot-header .identity {
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .15px;
  position: absolute;
  left: 93px;
  top: 9px;
  line-height: 20px;
}

.bot-header .identity .verified {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-left: 4px;
}

.bot-header small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #0c0d0e85;
  letter-spacing: .3px;
  margin-top: 0;
  line-height: 18px;
}

.bot-header .more {
  margin-left: auto;
  width: 58px;
  height: 56px;
}

.bot-composer {
  position: absolute;
  z-index: 3;
  bottom: calc(var(--navigation) + 8px);
  left: 16px;
  right: 16px;
  height: 100px;
  border-radius: 32px;
  background: #fafafaf2;
  border: 1px solid #fffc;


  box-shadow: 0 0 20px #20366e24;
}

.bot-composer input {
  height: 48px;
  width: 100%;
  padding: 0 19px;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 16px;
  letter-spacing: -.31px;
  padding-top: 5px;
}

.bot-composer input::placeholder {
  color: #0c0d0e66;
}

.composer-actions {
  height: 40px;
  display: block;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
}

.composer-actions .open {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: #007aff;
  font-size: 16px;
  font-weight: 500;
  padding: 0 6px;
  position: absolute;
  left: 14px;
  top: 2px;
  height: 36px;
  letter-spacing: -.31px;
}

.composer-actions button img {
  width: 24px;
  height: 24px;
}

.bot-gradient {
  z-index: 0;
  position: absolute;
  inset: 0 0 auto;
  height: calc(var(--status) + 66px);
  background: linear-gradient(#84c0f7f5,#84c0f7c7 53.3245%,transparent);
  pointer-events: none;
}

.composer-gradient {
  z-index: 0;
  position: absolute;
  height: 160px;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(transparent,#99d5d7e6 62%,#91cde5);
  pointer-events: none;
}

.bubble::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -2.7799px;
  width: 20.7799px;
  height: 18px;
  background: inherit;
  -webkit-mask-image: url('../assets/bubble-tail.svg');
  mask-image: url('../assets/bubble-tail.svg');
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  transform: scaleX(-1);
  pointer-events: none;
}

.bubble.outgoing::after {
  left: auto;
  right: -2.7799px;
  transform: none;
}

.bubble-text {
  position: absolute;
  left: 10px;
  top: 8px;
}

.product-card h3, .product-card p {
  position: absolute;
  left: 8px;
  margin: 0;
}

.composer-actions>.icon-button {
  position: absolute;
  top: 8px;
  width: 24px;
  height: 24px;
}

.composer-actions>.icon-button:nth-child(2) {
  left: calc(20px + (100% - 40px) * .43457944 - 12px);
}

.composer-actions>.icon-button:nth-child(3) {
  left: calc(20px + (100% - 40px) * .6105919 - 12px);
}

.composer-actions>.icon-button:nth-child(4) {
  left: calc(20px + (100% - 40px) * .78660436 - 12px);
}

.composer-actions>.icon-button:nth-child(5) {
  left: calc(20px + (100% - 40px) * .96261682 - 12px);
}

@media (max-width: 600px) { body { background: #fff; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }

/* Native app surfaces do not expose browser selection and tap overlays. */
html, body, body * {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
input, textarea, [contenteditable]:not([contenteditable="false"]), [contenteditable]:not([contenteditable="false"]) * {
  -webkit-user-select: text;
  user-select: text;
}
img, a { -webkit-user-drag: none; }
:focus:not(:focus-visible) { outline: none; }

#footer-tabs { scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
#footer-tabs::-webkit-scrollbar { display: none; }
#footer-tabs::after { content: ""; position: absolute; top: 0; left: var(--scroll-extent,0px); width: 1px; height: 1px; pointer-events: none; }
