@media (max-width: 991.98px) {
  html.kb-mobile.kw-mobile-on,
  html.kb-mobile.kw-mobile-on body {
    overflow: hidden !important;
    height: 100% !important;
    overscroll-behavior: none;
  }
  html.kb-mobile.kw-mobile-on #app { display: none !important; }
  html.kb-mobile.kw-mobile-on #kw-app { display: block; }
}

#kw-app {
  display: none;
  position: fixed; left: 0; top: 0; right: 0; bottom: 0;
  background: #eef1f6;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: #16233f;
  -webkit-text-size-adjust: 100%;
}

#kw-app .kw-cats-wrap {
  position: absolute; left: 0; right: 0;
  top: calc(56px + env(safe-area-inset-top));
  z-index: 9;
  background: #eef1f6;
  border-bottom: 1px solid #e6eaf1;
}

#kw-app .kw-scroll {
  position: absolute; left: 0; right: 0;
  top: calc(112px + env(safe-area-inset-top));
  bottom: calc(58px + env(safe-area-inset-bottom));
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 12px 16px;
}

#kw-app .kw-bar {
  position: absolute; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center;
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid #e9edf3;
}
#kw-app .kw-bar--top {
  top: 0; height: calc(56px + env(safe-area-inset-top));
  padding: calc(env(safe-area-inset-top)) 14px 0;
}
#kw-app .kw-bar--bot {
  bottom: 0; height: calc(58px + env(safe-area-inset-bottom));
  padding: 0 4px calc(env(safe-area-inset-bottom));
  border-bottom: 0; border-top: 1px solid #e9edf3;
}

#kw-app .kw-logo { flex: 1; font-size: 17px; font-weight: 700; letter-spacing: .3px; }
#kw-app .kw-logo span { color: #2f6df6; }
#kw-app .kw-tbtn {
  width: 38px; height: 38px; border: 0; background: transparent;
  font-size: 19px; line-height: 38px; text-align: center; padding: 0;
  color: #46536b; -webkit-appearance: none;
}
#kw-app .kw-tbtn:active { opacity: .5; }

#kw-app .kw-tab {
  flex: 1; border: 0; background: transparent; padding: 6px 0 0;
  font-size: 11px; color: #93a0b3; -webkit-appearance: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
#kw-app .kw-tab i { font-size: 19px; line-height: 22px; font-style: normal; }
#kw-app .kw-tab.on { color: #2f6df6; font-weight: 600; }

#kw-app .kw-cats {
  display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden;
  padding: 11px 12px; scrollbar-width: none; white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
#kw-app .kw-cats::-webkit-scrollbar { display: none; }
#kw-app .kw-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 13px; border: 0; border-radius: 17px;
  background: #fff; color: #46536b; font-size: 13px; -webkit-appearance: none;
  box-shadow: 0 1px 3px rgba(16,24,40,.05);
}
#kw-app .kw-chip img { width: 18px; height: 18px; object-fit: contain; }
#kw-app .kw-chip.on { background: #2f6df6; color: #fff; font-weight: 600; }
#kw-app .kw-chip.on img { filter: brightness(0) invert(1); }

#kw-app .kw-item {
  display: flex; gap: 11px; align-items: center;
  background: #fff; border-radius: 14px; padding: 12px;
  margin-bottom: 10px; box-shadow: 0 1px 4px rgba(16,24,40,.05);
}
#kw-app .kw-item:active { background: #f7f9fc; }
#kw-app .kw-item img {
  width: 54px; height: 54px; flex: 0 0 54px; object-fit: contain;
  border-radius: 10px; background: #f5f7fa;
}
#kw-app .kw-item-main { flex: 1; min-width: 0; }
#kw-app .kw-item-name {
  font-size: 13.5px; line-height: 1.45; font-weight: 600; color: #1d2a44;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#kw-app .kw-item-meta { margin-top: 6px; display: flex; align-items: baseline; gap: 8px; }
#kw-app .kw-item-price { font-size: 15px; font-weight: 700; color: #ef4444; }
#kw-app .kw-item-stock { font-size: 11.5px; color: #93a0b3; }
#kw-app .kw-item-go {
  flex: 0 0 auto; font-size: 12px; color: #2f6df6; font-weight: 600;
  padding: 6px 11px; border-radius: 9px; background: #eef4ff;
}

#kw-app .kw-more {
  text-align: center; color: #93a0b3; font-size: 12.5px; padding: 14px 0 20px;
}
#kw-app .kw-empty { text-align: center; color: #93a0b3; font-size: 13px; padding: 60px 0; }

#kw-sheet {
  position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 2147483200;
  display: flex; align-items: flex-end;
  background: rgba(10,20,40,.45);
}
#kw-sheet[hidden] { display: none !important; }
#kw-sheet .kw-sheet-box {
  width: 100%; max-height: 86%; overflow-y: auto;
  background: #fff; border-radius: 20px 20px 0 0;
  padding: 8px 18px calc(22px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
#kw-sheet .kw-sheet-grab {
  width: 38px; height: 4px; border-radius: 2px; background: #dfe4ec; margin: 6px auto 14px;
}
#kw-sheet .kw-sheet-head { display: flex; gap: 14px; align-items: flex-start; }
#kw-sheet .kw-sheet-head img {
  width: 76px; height: 76px; flex: 0 0 76px; object-fit: contain;
  border-radius: 14px; background: #f5f7fa;
}
#kw-sheet .kw-sheet-name { font-size: 15px; font-weight: 700; line-height: 1.5; }
#kw-sheet .kw-sheet-price { font-size: 20px; font-weight: 800; color: #ef4444; margin-top: 6px; }
#kw-sheet .kw-sheet-stock { font-size: 12px; color: #93a0b3; margin-top: 3px; }
#kw-sheet .kw-sheet-sec { margin-top: 16px; border-top: 1px solid #eef1f6; padding-top: 14px; }
#kw-sheet .kw-sheet-sec h4 { margin: 0 0 8px; font-size: 13px; color: #46536b; font-weight: 600; }
#kw-sheet .kw-sheet-desc {
  font-size: 13px; line-height: 1.75; color: #46536b; white-space: pre-wrap; word-break: break-word;
}
#kw-sheet .kw-sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
#kw-sheet .kw-sheet-actions button {
  flex: 1; height: 46px; border: 0; border-radius: 13px; font-size: 15px; font-weight: 600;
  -webkit-appearance: none;
}
#kw-sheet .kw-act-ghost { background: #f2f5f9; color: #46536b; }
#kw-sheet .kw-act-main { background: linear-gradient(180deg,#3b7bf8,#2f6df6); color: #fff; }
#kw-sheet .kw-sheet-actions button:active { opacity: .85; }

#kw-app .kw-item, #kw-app .kw-chip, #kw-app .kw-tab, #kw-app .kw-tbtn,
#kw-route .kw-route-close, #kw-sheet .kw-sheet-actions button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#kw-app .kw-item, #kw-app .kw-chip, #kw-app .kw-tab, #kw-app .kw-tbtn { cursor: pointer; }
#kw-sheet .kw-sheet-box { overscroll-behavior: contain; }
#kw-route .kw-route-body { -webkit-overflow-scrolling: touch; }
