/* TeenConnect focused UI fix: shopping completion, full-ratio home banners, TinTok mobile keyboard. */

/* 1) Home: real banner image ratio, no crop card or hard-coded copy while banners exist. */
body.page-home .home-main-banner-rail{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:18px!important;
  margin:0 0 34px!important;
}
body.page-home .home-main-banner{
  display:block!important;
  min-height:0!important;
  overflow:visible!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
body.page-home .home-main-banner picture,
body.page-home .home-main-banner img{
  display:block!important;
  width:100%!important;
  height:auto!important;
}
body.page-home .home-main-banner img{
  position:static!important;
  inset:auto!important;
  object-fit:contain!important;
  transform:none!important;
  transition:none!important;
}
body.page-home .home-main-banner:hover img{transform:none!important}
body.page-home .home-main-banner>span{display:none!important}

@media(max-width:800px){
  body.page-home .home-main-banner-rail{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:12px!important;
    overflow:visible!important;
    margin:0 0 22px!important;
    padding:0!important;
    scroll-snap-type:none!important;
  }
  body.page-home .home-main-banner{
    display:block!important;
    width:100%!important;
    flex:none!important;
    min-height:0!important;
    aspect-ratio:auto!important;
    border-radius:0!important;
  }
}

/* 2) TinShopping: user-facing order history and completion dialog. */
body.page-shopping .tintok-shop-head{
  align-items:center!important;
}
body.page-shopping .tintok-shop-head-tools{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}
body.page-shopping .tintok-order-history-link{
  min-height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.tinshopping-orders{
  display:grid;
  gap:18px;
  width:min(920px,100%);
  margin:0 auto;
}
.tinshopping-orders-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:2px 2px 0;
}
.tinshopping-orders-head h2{
  margin:4px 0 0;
  color:#162442;
  font-size:29px;
  letter-spacing:-1.2px;
}
.tinshopping-orders-head p{
  margin:6px 0 0;
  color:#71809a;
  font-size:13px;
}
.tinshopping-orders-list{
  display:grid;
  gap:11px;
}
.tinshopping-order-row{
  display:grid;
  grid-template-columns:78px minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
  padding:14px;
  border:1px solid #e1e8f6;
  border-radius:18px;
  background:#fff;
  box-shadow:0 8px 22px rgba(24,46,105,.055);
}
.tinshopping-order-thumb{
  display:grid;
  place-items:center;
  width:78px;
  height:78px;
  overflow:hidden;
  border-radius:15px;
  background:#edf3ff;
  color:#315ee6;
  font-size:27px;
}
.tinshopping-order-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.tinshopping-order-copy{
  min-width:0;
}
.tinshopping-order-copy b{
  display:block;
  overflow:hidden;
  color:#182441;
  font-size:15px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tinshopping-order-copy small{
  display:block;
  margin-top:7px;
  color:#74819b;
  font-size:12px;
}
.tinshopping-order-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:78px;
  min-height:32px;
  padding:7px 10px;
  border-radius:999px;
  background:#e9fff7;
  color:#168365;
  font-size:12px;
  font-style:normal;
  font-weight:850;
}
.tinshopping-order-empty{
  padding:50px 18px;
  border:1px dashed #d9e2f2;
  border-radius:18px;
  background:#fff;
  color:#73809a;
  text-align:center;
}
.tinshopping-order-success-backdrop{
  position:fixed;
  z-index:10050;
  inset:0;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(12,20,54,.42);
}
.tinshopping-order-success{
  width:min(410px,100%);
  padding:30px 26px 24px;
  border:1px solid rgba(255,255,255,.72);
  border-radius:26px;
  background:#fff;
  box-shadow:0 25px 70px rgba(8,21,70,.27);
  text-align:center;
}
.tinshopping-order-success-mark{
  display:grid;
  place-items:center;
  width:62px;
  height:62px;
  margin:0 auto 15px;
  border-radius:22px;
  background:linear-gradient(135deg,#39d8bd,#3b63ec);
  color:#fff;
  font-size:31px;
  font-weight:900;
}
.tinshopping-order-success h2{
  margin:0;
  color:#172343;
  font-size:23px;
  letter-spacing:-.9px;
}
.tinshopping-order-success p{
  margin:11px 0 21px;
  color:#697792;
  font-size:14px;
  line-height:1.6;
}
.tinshopping-order-success .primary-button{
  display:flex;
  width:100%;
  min-height:49px;
  align-items:center;
  justify-content:center;
}
@media(max-width:700px){
  .tinshopping-orders-head{align-items:flex-start;flex-direction:column}
  .tinshopping-order-row{grid-template-columns:62px minmax(0,1fr);gap:11px;padding:12px}
  .tinshopping-order-thumb{width:62px;height:62px;border-radius:13px}
  .tinshopping-order-status{grid-column:2;justify-self:start;min-height:28px}
  .tinshopping-order-success-backdrop{padding:16px}
  .tinshopping-order-success{padding:27px 21px 21px;border-radius:23px}
}

/* 3) TinTok mobile: one final keyboard-aware flex layout. */
@media(max-width:760px){
  html.tintok-mobile-room-open,
  body.tintok-mobile-room-open{
    overflow:hidden!important;
    height:100%!important;
    min-height:0!important;
    overscroll-behavior:none!important;
  }
  body.tintok-mobile-room-open .tintok-chat-layout{
    position:fixed!important;
    z-index:9000!important;
    top:0!important;
    right:0!important;
    bottom:auto!important;
    left:0!important;
    width:100vw!important;
    height:var(--tc-tintok-keyboard-safe-height,100dvh)!important;
    min-height:0!important;
    max-height:var(--tc-tintok-keyboard-safe-height,100dvh)!important;
    transform:none!important;
  }
  body.tintok-mobile-room-open .tintok-chat-window{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    overflow:hidden!important;
  }
  body.tintok-mobile-room-open .tintok-chat-head,
  body.tintok-mobile-room-open .tintok-chat-search-panel,
  body.tintok-mobile-room-open .tintok-notice-bar{
    flex:0 0 auto!important;
  }
  body.tintok-mobile-room-open .tintok-messages{
    position:relative!important;
    flex:1 1 0!important;
    min-height:0!important;
    height:auto!important;
    padding:14px 13px 16px!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    scroll-padding-bottom:16px!important;
    -webkit-overflow-scrolling:touch!important;
  }
  body.tintok-mobile-room-open .tintok-composer{
    position:relative!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    flex:0 0 auto!important;
    width:100%!important;
    margin:0!important;
    padding:9px 11px calc(9px + env(safe-area-inset-bottom,0px))!important;
    border-top:1px solid #dfe6f3!important;
    background:#fff!important;
    box-shadow:0 -8px 20px rgba(25,40,91,.08)!important;
  }
}
