/* Mobile H5 light theme — desktop (≥769px) unchanged */
@media (max-width: 768px) {
  :root {
    --h5-primary: #2f6bff;
    --h5-bg: #f4f7fb;
    --h5-surface: #ffffff;
    --h5-text: #1a2332;
    --h5-muted: #8b95a8;
    --h5-border: #e8eef5;
    --h5-success: #16a34a;
    --h5-danger: #ef4444;
    --h5-radius: 16px;
    --h5-header-h: 56px;
    --h5-backbar-h: 50px;
    --h5-nav-bg-h: 52px;
    --h5-top-chrome: calc(var(--h5-header-h) + var(--h5-backbar-h));
  }

  body {
    background: var(--h5-bg) !important;
    color: var(--h5-text) !important;
    padding-bottom: calc(var(--h5-nav-bg-h) + env(safe-area-inset-bottom) + 4px) !important;
  }

  /* Compact top header on mobile */
  body > header {
    height: 56px !important;
    padding: 0 14px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    border-bottom: 1px solid var(--h5-border) !important;
    backdrop-filter: blur(12px);
  }
  body > header nav {
    display: none !important;
  }
  body > header .logo-container img {
    height: 26px !important;
    filter: none !important;
  }
  body > header .logo-text {
    color: var(--h5-text) !important;
    -webkit-text-fill-color: var(--h5-text) !important;
    background: none !important;
    font-size: 16px !important;
  }
  body > header .btn-login {
    color: var(--h5-primary) !important;
    border-color: transparent !important;
    background: transparent !important;
  }
  body > header .btn-register {
    background: var(--h5-primary) !important;
    color: #fff !important;
    border-radius: 20px !important;
    padding: 6px 14px !important;
  }
  body > header .lang-switcher,
  body > header .user-center .profile-trigger {
    color: var(--h5-text) !important;
  }
  body > header .user-dropdown,
  body > header .lang-dropdown {
    background: #fff !important;
    border: 1px solid var(--h5-border) !important;
    color: var(--h5-text) !important;
  }
  body > header .lang-dropdown a {
    color: #1a2332 !important;
    font-weight: 600 !important;
  }
  body > header .lang-dropdown a:hover {
    background: #eaf1ff !important;
    color: #2f6bff !important;
  }
  body > header .lang-switcher {
    background: #fff !important;
    border-color: #2f6bff !important;
    color: #1a2332 !important;
  }
  body > header .lang-switcher span {
    color: #1a2332 !important;
    display: inline !important;
    font-weight: 600;
  }

  .h5-tabs a,
  .h5-tabs button {
    color: #4b5563 !important;
    font-weight: 600 !important;
  }
  .h5-tabs a.active,
  .h5-tabs button.active {
    color: #2f6bff !important;
    font-weight: 800 !important;
  }

  /* Hide desktop footer on mobile */
  body > footer {
    display: none !important;
  }

  /* Bottom nav — compact white background, icons stay at bottom */
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    z-index: 10000;
    height: calc(var(--h5-nav-bg-h) + env(safe-area-inset-bottom)) !important;
    background: transparent !important;
    border-top: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-nav::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--h5-nav-bg-h) + env(safe-area-inset-bottom));
    transform: none;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 0;
    pointer-events: none;
  }
  .mobile-nav a {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    flex: 1;
    padding: 4px 0 6px;
    color: var(--h5-muted) !important;
    font-size: 10px !important;
    font-weight: 500;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav a i {
    font-size: 22px !important;
    margin-bottom: 2px;
  }
  .mobile-nav a.active {
    color: var(--h5-primary) !important;
  }
  .mobile-nav a span {
    transform: scale(0.9);
  }
  .mobile-nav a.active span {
    transform: scale(1);
    font-weight: 700;
  }

  #cs-widget {
    bottom: 78px !important;
    right: 16px !important;
  }
  #cs-widget .btn,
  #cs-widget a.btn {
    width: 52px !important;
    height: 52px !important;
  }

  /* Shared H5 components */
  .h5-page {
    padding: 12px 16px 24px;
    min-height: calc(100vh - 56px - 64px);
  }
  .h5-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--h5-border);
    border-radius: 24px;
    padding: 10px 14px;
    margin-bottom: 14px;
  }
  .h5-search i { color: var(--h5-muted); }
  .h5-search input {
    border: 0;
    outline: none;
    background: transparent;
    flex: 1;
    font-size: 14px;
    color: var(--h5-text);
  }
  .h5-banner {
    border-radius: var(--h5-radius);
    overflow: hidden;
    background: linear-gradient(135deg, #2f6bff 0%, #5b8cff 55%, #7aa2ff 100%);
    color: #fff;
    padding: 20px 18px;
    margin-bottom: 16px;
    position: relative;
    min-height: 110px;
  }
  .h5-banner h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px;
  }
  .h5-banner p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
  }
  .h5-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--h5-text);
    margin: 8px 0 12px;
  }
  .h5-scroll-cards {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .h5-scroll-cards::-webkit-scrollbar { display: none; }
  .h5-price-card {
    min-width: 140px;
    background: #fff;
    border: 1px solid var(--h5-border);
    border-radius: 14px;
    padding: 12px;
    text-decoration: none !important;
    color: inherit;
  }
  .h5-price-card .sym {
    font-weight: 700;
    font-size: 13px;
    color: var(--h5-text);
  }
  .h5-price-card .price {
    font-weight: 700;
    font-size: 15px;
    margin-top: 6px;
    color: var(--h5-text);
  }
  .h5-price-card .chg {
    font-size: 12px;
    font-weight: 600;
  }
  .h5-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 8px;
    background: #fff;
    border-radius: var(--h5-radius);
    padding: 16px 10px;
    border: 1px solid var(--h5-border);
    margin-bottom: 16px;
  }
  .h5-grid a {
    text-align: center;
    text-decoration: none !important;
    color: var(--h5-text);
  }
  .h5-grid .icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    margin: 0 auto 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef3ff;
    color: var(--h5-primary);
    font-size: 20px;
  }
  .h5-grid span {
    display: block;
    font-size: 11px;
    color: var(--h5-muted);
  }
  .h5-tabs {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--h5-border);
    scrollbar-width: none;
  }
  .h5-tabs::-webkit-scrollbar { display: none; }
  .h5-tabs a,
  .h5-tabs button {
    border: 0;
    background: none;
    padding: 10px 2px 12px;
    font-size: 14px;
    color: var(--h5-muted);
    white-space: nowrap;
    font-weight: 500;
    position: relative;
    text-decoration: none;
  }
  .h5-tabs a.active,
  .h5-tabs button.active {
    color: var(--h5-primary);
    font-weight: 700;
  }
  .h5-tabs a.active::after,
  .h5-tabs button.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--h5-primary);
    border-radius: 2px;
  }
  .h5-list {
    background: #fff;
    border-radius: var(--h5-radius);
    border: 1px solid var(--h5-border);
    overflow: hidden;
  }
  .h5-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px;
    border-bottom: 1px solid var(--h5-border);
    text-decoration: none !important;
    color: inherit;
  }
  .h5-list-item:last-child { border-bottom: 0; }
  .h5-list-item .left {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .h5-list-item .name {
    font-weight: 700;
    font-size: 14px;
    color: var(--h5-text);
  }
  .h5-list-item .sub {
    font-size: 11px;
    color: var(--h5-muted);
  }
  .h5-list-item .right {
    text-align: right;
  }
  .h5-list-item .price {
    font-weight: 700;
    font-size: 14px;
    color: var(--h5-text);
  }
  .h5-chg-up { color: var(--h5-success) !important; }
  .h5-chg-down { color: var(--h5-danger) !important; }
  .h5-badge-chg {
    display: inline-block;
    min-width: 68px;
    text-align: center;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #fff !important;
  }
  .h5-badge-chg.up { background: var(--h5-success); }
  .h5-badge-chg.down { background: var(--h5-danger); }

  /* Auth mobile */
  body.h5-auth > header,
  body.h5-auth > footer,
  body.h5-auth .mobile-nav,
  body.h5-auth #cs-widget {
    display: none !important;
  }
  body.h5-auth {
    padding-bottom: 0 !important;
    background: #fff !important;
  }
  /* Auth pages hide site header — back bar must stick to top:0 so it won't cover the logo */
  body.h5-auth .h5-back-bar {
    top: 0 !important;
    padding: 8px 16px !important;
  }
  body.h5-auth .h5-auth-wrap {
    padding-top: 16px;
  }
  .h5-auth-wrap {
    padding: 28px 20px 40px;
    max-width: 440px;
    margin: 0 auto;
  }
  .h5-auth-wrap h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--h5-text);
    margin-bottom: 6px;
  }
  .h5-auth-wrap .sub {
    color: var(--h5-muted);
    margin-bottom: 22px;
    font-size: 14px;
  }
  .h5-auth-tabs {
    display: flex;
    background: #f0f4fa;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 22px;
  }
  .h5-auth-tabs a {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--h5-muted);
    font-weight: 600;
    font-size: 14px;
  }
  .h5-auth-tabs a.active {
    background: #fff;
    color: var(--h5-primary);
    box-shadow: 0 2px 8px rgba(47, 107, 255, 0.12);
  }
  .h5-auth-wrap .form-control {
    background: #f5f8fc !important;
    border: 1px solid var(--h5-border) !important;
    color: var(--h5-text) !important;
    border-radius: 12px !important;
  }
  .h5-auth-wrap .form-label {
    color: var(--h5-text) !important;
  }
  .h5-auth-wrap .btn-primary {
    background: var(--h5-primary) !important;
    border: 0 !important;
    border-radius: 12px !important;
  }
  .h5-auth-wrap .form-check-input {
    width: 1.2em !important;
    height: 1.2em !important;
  }

  .h5-toast {
    position: fixed;
    left: 50%;
    bottom: 96px;
    transform: translateX(-50%) translateY(20px);
    z-index: 3000;
    max-width: 86%;
    padding: 12px 18px;
    border-radius: 12px;
    background: #1a2332;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all .25s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
  }
  .h5-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  .h5-toast.ok { background: #15803d; }
  .h5-toast.err { background: #dc2626; }
  .h5-modal {
    position: fixed;
    inset: 0;
    z-index: 3100;
    background: rgba(15,23,42,.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  .h5-modal.show { display: flex; }
  .h5-modal-card {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,.2);
  }
  .h5-modal-title {
    font-size: 16px;
    font-weight: 800;
    color: #1a2332;
    margin-bottom: 12px;
  }
  .h5-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
  }
  .h5-modal-actions .btn { flex: 1; }

  /* Splash */
  body.h5-splash > header,
  body.h5-splash > footer,
  body.h5-splash .mobile-nav,
  body.h5-splash #cs-widget {
    display: none !important;
  }
  body.h5-splash {
    padding-bottom: 0 !important;
    background: linear-gradient(180deg, #eaf1ff 0%, #ffffff 55%) !important;
  }
  .h5-splash {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 48px 24px 36px;
    text-align: center;
  }
  .h5-splash .hero-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--h5-text);
    line-height: 1.35;
    margin-bottom: 10px;
  }
  .h5-splash .hero-sub {
    color: var(--h5-muted);
    font-size: 13px;
    margin-bottom: 28px;
  }
  .h5-splash .globe {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0 24px;
  }
  .h5-splash .globe-circle {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #6b9bff, #2f6bff 55%, #1d4ed8);
    box-shadow: 0 30px 60px rgba(47, 107, 255, 0.35);
    position: relative;
  }
  .h5-splash .globe-circle::after {
    content: '';
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.25);
  }
  .h5-splash .tags {
    color: var(--h5-muted);
    font-size: 13px;
    letter-spacing: 2px;
    margin-bottom: 22px;
  }
  .h5-splash .btn-cta {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    background: var(--h5-primary);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
    font-size: 16px;
  }

  /* Assets / Mine */
  .h5-asset-hero {
    background: linear-gradient(135deg, #2f6bff, #5b8cff);
    border-radius: 18px;
    color: #fff;
    padding: 20px 18px;
    margin-bottom: 14px;
  }
  .h5-asset-hero .label {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .h5-asset-hero .amount {
    font-size: 28px;
    font-weight: 800;
    margin: 8px 0 14px;
  }
  .h5-asset-actions {
    display: flex;
    gap: 10px;
  }
  .h5-asset-actions a {
    flex: 1;
    text-align: center;
    background: rgba(255,255,255,0.18);
    color: #fff !important;
    text-decoration: none !important;
    padding: 10px 6px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
  }
  .h5-mine-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
  }
  .h5-mine-avatar {
    width: 64px;
    height: auto;
    min-height: 64px;
    border-radius: 0;
    background: transparent;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    font-size: 22px;
    font-weight: 700;
    position: relative;
    flex-shrink: 0;
    overflow: visible;
  }
  .h5-mine-avatar .h5-avatar-letter {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #9ec0ff, #c9dbff);
    color: #1e3a8a;
    font-size: 26px;
    font-weight: 800;
    flex-shrink: 0;
  }
  .h5-mine-avatar .h5-avatar-cam {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    margin-top: -10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2f6bff;
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(47,107,255,0.25);
  }
  .h5-kyc-card {
    background: linear-gradient(135deg, #2f6bff, #5b8cff);
    color: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none !important;
    margin-bottom: 16px;
  }
  .h5-kyc-card span { color: #fff; }
  .h5-menu-card {
    background: #fff;
    border: 1px solid var(--h5-border);
    border-radius: var(--h5-radius);
    overflow: hidden;
    margin-bottom: 14px;
  }
  .h5-menu-card a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--h5-border);
    text-decoration: none !important;
    color: var(--h5-text);
    font-size: 14px;
  }
  .h5-menu-card a:last-child { border-bottom: 0; }
  .h5-menu-card a i.lead {
    color: var(--h5-primary);
    margin-right: 10px;
    font-size: 18px;
  }
  .h5-menu-card .chev { color: var(--h5-muted); }

  /* News cards */
  .h5-news-card {
    display: flex;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--h5-border);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    text-decoration: none !important;
    color: inherit;
  }
  .h5-news-thumb {
    width: 88px;
    height: 68px;
    border-radius: 10px;
    background: linear-gradient(135deg, #dbe7ff, #f0f4fa);
    flex-shrink: 0;
  }
  .h5-news-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--h5-text);
    line-height: 1.35;
  }
  .h5-news-card .meta {
    font-size: 11px;
    color: var(--h5-muted);
  }

  /* Override common dark page wrappers on mobile for H5 pages */
  .h5-page .card,
  .h5-page .bg-surface {
    background: #fff !important;
    border-color: var(--h5-border) !important;
    color: var(--h5-text) !important;
  }
  .h5-page .text-white,
  .h5-page .text-white-50 {
    color: var(--h5-text) !important;
  }
  .h5-page .text-white-50 {
    color: var(--h5-muted) !important;
  }

  /* Terminal light shell */
  .terminal-container {
    background: var(--h5-bg) !important;
    color: var(--h5-text) !important;
  }
  .mobile-type-switcher {
    background: #fff !important;
    border-bottom: 1px solid var(--h5-border) !important;
    padding: 8px 12px !important;
  }
  .mobile-type-switcher .switcher-module {
    background: #f0f4fa !important;
    border-radius: 12px !important;
    padding: 4px !important;
    display: flex !important;
  }
  .mobile-type-switcher .switcher-item {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    border-radius: 10px;
    color: var(--h5-muted) !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
  }
  .mobile-type-switcher .switcher-item.active {
    background: #fff !important;
    color: var(--h5-primary) !important;
    box-shadow: 0 2px 8px rgba(47, 107, 255, 0.12);
  }
  .terminal-header {
    background: #fff !important;
    border-color: var(--h5-border) !important;
  }
  .terminal-header .text-white,
  .terminal-header i {
    color: var(--h5-text) !important;
  }
  .terminal-sidebar {
    background: #fff !important;
    border-color: var(--h5-border) !important;
  }
  .terminal-sidebar .sidebar-tabs,
  .terminal-sidebar .terminal-top-nav {
    background: #f4f7fb !important;
    border-bottom: 1px solid var(--h5-border) !important;
  }
  .terminal-sidebar .sidebar-tabs .terminal-tab {
    background: #ffffff !important;
    border: 1px solid #e5eaf2 !important;
    color: #1a2332 !important;
  }
  .terminal-sidebar .sidebar-tabs .terminal-tab i,
  .terminal-sidebar .sidebar-tabs .terminal-tab span {
    color: #1a2332 !important;
    filter: none !important;
  }
  .terminal-sidebar .sidebar-tabs .terminal-tab.active {
    background: #2f6bff !important;
    border-color: #2f6bff !important;
    color: #fff !important;
  }
  .terminal-sidebar .sidebar-tabs .terminal-tab.active i,
  .terminal-sidebar .sidebar-tabs .terminal-tab.active span {
    color: #fff !important;
  }
  .terminal-sidebar .symbol,
  .terminal-sidebar .price,
  .terminal-sidebar .coin-row .symbol,
  .terminal-sidebar .coin-row .price,
  .terminal-sidebar .text-white {
    color: #1a2332 !important;
  }
  .sidebar-search input {
    background: #f5f8fc !important;
    color: var(--h5-text) !important;
    border-color: var(--h5-border) !important;
  }

  /* Binary fonts: force dark labels on light chips */
  .cycle-btn .cycle-time {
    color: #111827 !important;
    font-weight: 800 !important;
  }
  .cycle-btn .cycle-profit {
    color: #15803d !important;
    font-weight: 700 !important;
  }
  .cycle-btn.active .cycle-time,
  .cycle-btn.active .cycle-profit {
    color: #1d4ed8 !important;
  }
  .trade-pct-btn,
  .quick-amounts .btn {
    color: #111827 !important;
    font-weight: 800 !important;
    background: #eef2f7 !important;
    border-color: #dbe3ee !important;
  }

  /* Depth no ghosting */
  .terminal-chart {
    overflow: hidden !important;
    background: #fff !important;
  }
  #depth-container,
  .depth-panel {
    background: #ffffff !important;
  }
  .trading-panels,
  .binary-order-panel,
  .spot-order-panel,
  .contract-order-panel {
    background: #ffffff !important;
    isolation: isolate;
  }

  /* Force light theme on ALL mobile pages: cards, forms, text */
  .card,
  .bg-surface,
  .bg-darker,
  .list-group-item,
  .modal-content,
  .table-dark,
  .dropdown-menu {
    background: #fff !important;
    background-color: #fff !important;
    color: var(--h5-text) !important;
    border-color: var(--h5-border) !important;
  }
  .bg-black,
  .bg-dark,
  .bg-black.bg-opacity-20,
  .bg-black.bg-opacity-25,
  .bg-black.bg-opacity-30,
  .bg-black.bg-opacity-50,
  .card-header {
    background: #f5f8fc !important;
    background-color: #f5f8fc !important;
    color: var(--h5-text) !important;
    border-color: var(--h5-border) !important;
  }
  .text-white,
  .text-light,
  h1, h2, h3, h4, h5, h6,
  .fw-bold.text-white,
  label, .form-label {
    color: var(--h5-text) !important;
  }
  .text-white-50,
  .text-muted,
  .text-light-50,
  .small.text-white-50 {
    color: var(--h5-muted) !important;
  }
  .form-control,
  .form-select,
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  textarea, select {
    background: #f5f8fc !important;
    color: var(--h5-text) !important;
    border-color: var(--h5-border) !important;
  }
  .form-check-input {
    width: 1.15em !important;
    height: 1.15em !important;
    margin-top: 0.15em;
    background-color: #ffffff !important;
    border: 2px solid #2f6bff !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer;
    flex-shrink: 0;
  }
  .form-check-input:checked {
    background-color: #2f6bff !important;
    border-color: #2f6bff !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
  }
  .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(47,107,255,0.25) !important;
  }
  .h5-auth-wrap .form-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
  }
  .h5-auth-wrap .form-check-label {
    color: #4b5563 !important;
    line-height: 1.4;
  }
  .form-control::placeholder {
    color: #a0aab8 !important;
  }
  .form-control:focus,
  .form-select:focus {
    background: #fff !important;
    color: var(--h5-text) !important;
    border-color: var(--h5-primary) !important;
  }
  .table,
  .table-dark,
  .table td,
  .table th {
    --bs-table-bg: #fff !important;
    --bs-table-color: var(--h5-text) !important;
    --bs-table-border-color: var(--h5-border) !important;
    color: var(--h5-text) !important;
    background: #fff !important;
    border-color: var(--h5-border) !important;
  }
  .btn-outline-light,
  .btn-outline-secondary {
    color: var(--h5-text) !important;
    border-color: var(--h5-border) !important;
    background: #fff !important;
  }
  a.text-white-50,
  .h5-back,
  .h5-back a {
    color: var(--h5-text) !important;
  }
  .border-secondary {
    border-color: var(--h5-border) !important;
  }

  /* Back bar */
  .h5-back-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid var(--h5-border);
    position: sticky;
    top: 56px;
    z-index: 900;
  }
  .h5-back-bar a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--h5-text) !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 15px;
  }
  .h5-back-bar .title {
    flex: 1;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--h5-text);
    margin-right: 28px;
  }

  /* Home header row (logo + search + bell) */
  .h5-home-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
  }
  .h5-home-top .h5-logo-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: contain;
    flex-shrink: 0;
  }
  .h5-home-top .h5-search {
    flex: 1;
    margin-bottom: 0;
  }
  .h5-home-top .bell {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--h5-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--h5-text);
    text-decoration: none;
  }
  .h5-banner-ai {
    border-radius: 18px;
    overflow: hidden;
    background:
      radial-gradient(circle at 85% 30%, rgba(255,255,255,0.25), transparent 40%),
      radial-gradient(circle at 70% 80%, rgba(255,216,77,0.25), transparent 35%),
      linear-gradient(135deg, #15357a 0%, #2f6bff 45%, #5b8cff 100%);
    color: #fff;
    padding: 20px 18px 18px;
    margin-bottom: 16px;
    position: relative;
    min-height: 148px;
  }
  .h5-banner-ai .tag {
    display: inline-block;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.28);
    color: #fff !important;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    margin-bottom: 8px;
  }
  .h5-banner-ai h3 {
    color: #fff !important;
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 6px;
    max-width: 58%;
    line-height: 1.35;
  }
  .h5-banner-ai .desc {
    color: rgba(255,255,255,0.9) !important;
    font-size: 11px;
    margin: 0 0 12px;
    max-width: 58%;
    line-height: 1.4;
  }
  .h5-banner-ai .cta {
    display: inline-block;
    background: #ffd84d;
    color: #1a2332 !important;
    font-weight: 800;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  }
  .h5-banner-ai .bot {
    position: absolute;
    right: 6px;
    bottom: 4px;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }
  .h5-banner-ai .bot svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.25));
  }

  /* Quick market: 3 equal cards fully visible */
  #h5-home-cards.h5-scroll-cards {
    display: flex;
    gap: 6px;
    overflow: hidden;
    padding-bottom: 4px;
    width: 100%;
    box-sizing: border-box;
  }
  #h5-home-cards .h5-quote-card {
    flex: 1 1 0;
    min-width: 0;
    max-width: calc((100% - 12px) / 3);
    width: 0;
    padding: 8px 6px;
    box-sizing: border-box;
    overflow: hidden;
  }
  #h5-home-cards .h5-quote-card .sym {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #h5-home-cards .h5-quote-card .price {
    font-size: 12px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #h5-home-cards .h5-quote-card .chg {
    font-size: 10px;
  }
  #h5-home-cards .h5-quote-card canvas {
    width: 100% !important;
    max-width: 100% !important;
    height: 26px !important;
  }
  .h5-quote-card {
    border-radius: 14px;
    text-decoration: none !important;
    display: block;
    border: 1px solid transparent;
  }
  .h5-quote-card.up {
    background: #eafaf1;
    border-color: #cdeed9;
  }
  .h5-quote-card.down {
    background: #fdeeee;
    border-color: #f6d5d5;
  }
  .h5-quote-card .top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
  }
  .h5-quote-card .sym {
    font-size: 12px;
    font-weight: 700;
  }
  .h5-quote-card.up .sym,
  .h5-quote-card.up .chg,
  .h5-quote-card.up .price { color: #16a34a !important; }
  .h5-quote-card.down .sym,
  .h5-quote-card.down .chg,
  .h5-quote-card.down .price { color: #ef4444 !important; }
  .h5-quote-card .chg { font-size: 11px; font-weight: 700; }
  .h5-quote-card .price {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 6px;
  }
  .h5-quote-card canvas {
    width: 100% !important;
    height: 36px !important;
  }

  /* Swap light mobile — override inline dark styles */
  .swap-page .swap-main-card,
  .swap-page .h5-swap-card {
    background: #ffffff !important;
    border: 1px solid #e8eef5 !important;
    box-shadow: 0 8px 24px rgba(26,35,50,0.06) !important;
  }
  .swap-page .swap-title,
  .swap-page .h5-swap-card h3 {
    color: #1a2332 !important;
    font-weight: 800 !important;
  }
  .swap-page .swap-title .text-primary,
  .swap-page .swap-title i {
    color: #2f6bff !important;
  }
  .swap-page .h5-swap-box {
    background: #f5f8fc !important;
    border: 1px solid #e8eef5 !important;
  }
  .swap-page .h5-swap-box .lbl,
  .swap-page .h5-swap-box .bal {
    color: #4b5563 !important;
    font-weight: 700 !important;
  }
  .swap-page .h5-swap-box .val,
  .swap-page .h5-swap-box .fw-bold,
  .swap-page .swap-amt {
    color: #1a2332 !important;
  }
  .swap-page .swap-coin-btn {
    background: #ffffff !important;
    border-color: #e8eef5 !important;
    color: #1a2332 !important;
  }
  .swap-page .h5-swap-meta {
    background: #f8fafc !important;
    border: 1px solid #e8eef5 !important;
  }
  .swap-page .h5-swap-meta .row-line,
  .swap-page .h5-swap-meta .fw-medium {
    color: #4b5563 !important;
  }
  .swap-page .h5-swap-meta .val,
  .swap-page .h5-swap-meta #swap-rate {
    color: #1a2332 !important;
    font-weight: 700 !important;
  }
  .swap-page .swap-dd {
    background: #fff !important;
  }
  .swap-page .swap-dd .dropdown-item {
    color: #1a2332 !important;
  }

  /* CS chat light bubbles */
  #cs-box {
    background: #fff !important;
    border-color: var(--h5-border) !important;
    color: #1a2332 !important;
  }
  #cs-box .bg-primary {
    background: #2f6bff !important;
  }
  #cs-box .bg-primary span,
  #cs-box .bg-primary .fw-bold {
    color: #fff !important;
  }
  #cs-messages {
    background: #f7f9fc !important;
  }
  #cs-messages .bubble-user {
    background: #2f6bff !important;
    color: #fff !important;
    border: 0 !important;
  }
  #cs-messages .bubble-admin {
    background: #ffffff !important;
    color: #1a2332 !important;
    border: 1px solid #e5eaf2 !important;
  }
  #cs-messages .message-text {
    color: inherit !important;
    font-weight: 500 !important;
    font-size: 14px !important;
  }
  #cs-box .bg-black,
  #cs-box .border-top {
    background: #fff !important;
    border-color: var(--h5-border) !important;
  }
  #cs-input {
    background: #f5f8fc !important;
    color: #1a2332 !important;
    border-color: var(--h5-border) !important;
  }

  /* Trade switcher clearer */
  .mobile-type-switcher .switcher-item {
    color: #6b7280 !important;
    font-weight: 700 !important;
  }
  .mobile-type-switcher .switcher-item.active {
    background: #2f6bff !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(47,107,255,0.25) !important;
  }
  .h5-sec-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0 10px;
  }
  .h5-sec-head .more-link {
    font-size: 12px;
    color: var(--h5-muted);
    text-decoration: none;
  }
  .h5-grid .icon.c1 { background: #fff4d6; color: #d97706; }
  .h5-grid .icon.c2 { background: #e8f0ff; color: #2f6bff; }
  .h5-grid .icon.c3 { background: #f3e8ff; color: #7c3aed; }
  .h5-grid .icon.c4 { background: #ffedd5; color: #ea580c; }
  .h5-grid .icon.c5 { background: #ede9fe; color: #6d28d9; }
  .h5-grid .icon.c6 { background: #ffedd5; color: #c2410c; }
  .h5-grid .icon.c7 { background: #dcfce7; color: #16a34a; }
  .h5-grid .icon.c8 { background: #f1f5f9; color: #64748b; }

  /* AI analysis cards */
  .h5-ai-card {
    display: block;
    border-radius: 16px;
    padding: 18px 16px;
    margin-bottom: 12px;
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
    min-height: 88px;
  }
  .h5-ai-card h4 {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 6px;
  }
  .h5-ai-card p {
    margin: 0;
    font-size: 12px;
    color: var(--h5-muted) !important;
    max-width: 70%;
  }
  .h5-ai-card .ico {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 36px;
    opacity: 0.9;
  }
  .h5-ai-card.blue { background: #eaf1ff; }
  .h5-ai-card.blue h4 { color: #1d4ed8 !important; }
  .h5-ai-card.orange { background: #fff4e8; }
  .h5-ai-card.orange h4 { color: #c2410c !important; }
  .h5-ai-card.teal { background: #e6fbf7; }
  .h5-ai-card.teal h4 { color: #0f766e !important; }
  .h5-ai-start {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--h5-primary);
    color: #fff !important;
    font-weight: 800;
    padding: 14px;
    border-radius: 999px;
    text-decoration: none !important;
    border: 0;
    margin-top: 18px;
  }

  /* AI chat */
  .h5-chat-wrap {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 56px - 64px - 50px);
    background: #f7f9fc;
  }
  .h5-chat-msgs {
    flex: 1;
    padding: 14px 16px 100px;
    overflow-y: auto;
  }
  .h5-msg {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    max-width: 92%;
  }
  .h5-msg.bot { align-self: flex-start; }
  .h5-msg.user { align-self: flex-end; margin-left: auto; flex-direction: row-reverse; }
  .h5-msg .av {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2f6bff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
  }
  .h5-msg .bubble {
    background: #fff;
    border: 1px solid var(--h5-border);
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--h5-text);
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
  }
  .h5-msg.user .bubble {
    background: var(--h5-primary);
    color: #fff !important;
    border: 0;
  }
  .h5-chat-quick {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    overflow-x: auto;
    background: #fff;
    border-top: 1px solid var(--h5-border);
  }
  .h5-chat-quick button {
    white-space: nowrap;
    border: 0;
    background: #eaf1ff;
    color: #1d4ed8;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
  }
  .h5-chat-input {
    display: flex;
    gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--h5-border);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 64px;
    z-index: 950;
  }
  .h5-chat-input input {
    flex: 1;
    border-radius: 22px !important;
    padding: 10px 14px !important;
  }
  .h5-chat-input button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 0;
    background: var(--h5-primary);
    color: #fff;
  }

  /* Terminal remaining dark panels */
  .trading-panels,
  .terminal-chart,
  .orderbook,
  .trade-history,
  .spot-order-panel,
  .contract-order-panel,
  .binary-order-panel,
  .interval-tabs,
  .chart-tabs {
    background: #fff !important;
    color: var(--h5-text) !important;
    border-color: var(--h5-border) !important;
  }
  .trading-panels {
    background: #f4f7fb !important;
  }
  .interval-tab,
  .chart-tab,
  .order-tab {
    color: var(--h5-muted) !important;
  }
  .interval-tab.active,
  .chart-tab.active,
  .order-tab.active {
    color: var(--h5-primary) !important;
  }
  .coin-row:hover,
  .coin-row.active {
    background: #f0f4fa !important;
  }
  .terminal-chart,
  #tv-chart-container,
  #tradingview_chart {
    background: #ffffff !important;
  }
  .terminal-container .section-title,
  .terminal-container .balance-highlight,
  .trading-panels .text-white {
    color: #1a2332 !important;
  }
  .toolbar-item.active {
    color: var(--h5-primary) !important;
    background: #eaf1ff !important;
  }
  .terminal-container .text-white { color: var(--h5-text) !important; }
  .terminal-container .form-control,
  .terminal-container input {
    background: #f5f8fc !important;
    color: var(--h5-text) !important;
  }

  /* App download page — light mobile theme */
  .app-page-wrapper {
    background: #f4f7fb !important;
    color: #1a2332 !important;
  }
  .app-page-wrapper .app-hero,
  .app-page-wrapper .bg-gradient-dark,
  .app-page-wrapper section {
    background: #f4f7fb !important;
  }
  .app-page-wrapper .bg-gradient-dark-reverse,
  .app-page-wrapper section[style*="#080a0c"] {
    background: #ffffff !important;
  }
  .app-page-wrapper .display-3,
  .app-page-wrapper h1,
  .app-page-wrapper h2,
  .app-page-wrapper h4,
  .app-page-wrapper h5,
  .app-page-wrapper .text-white,
  .app-page-wrapper .lead {
    color: #1a2332 !important;
    -webkit-text-fill-color: #1a2332 !important;
    background: none !important;
    opacity: 1 !important;
  }
  .app-page-wrapper .text-gradient-primary-light {
    color: #2f6bff !important;
    -webkit-text-fill-color: #2f6bff !important;
    background: none !important;
  }
  .app-page-wrapper .text-white-50,
  .app-page-wrapper .opacity-75,
  .app-page-wrapper .lead.opacity-75,
  .app-page-wrapper p {
    color: #4b5563 !important;
    opacity: 1 !important;
  }
  .app-page-wrapper .download-btn-modern {
    background: #ffffff !important;
    border: 1px solid #e5eaf2 !important;
    box-shadow: 0 4px 14px rgba(26,35,50,0.06);
  }
  .app-page-wrapper .download-btn-modern .text-white,
  .app-page-wrapper .download-btn-modern .store,
  .app-page-wrapper .download-btn-modern i {
    color: #1a2332 !important;
  }
  .app-page-wrapper .download-btn-modern .text-white-50,
  .app-page-wrapper .download-btn-modern span {
    color: #6b7280 !important;
  }
  .app-page-wrapper .smart-download {
    background: linear-gradient(135deg, #2f6bff, #5b8cff) !important;
    border-color: transparent !important;
  }
  .app-page-wrapper .smart-download .text-white,
  .app-page-wrapper .smart-download .store,
  .app-page-wrapper .smart-download i,
  .app-page-wrapper .smart-download span,
  .app-page-wrapper .smart-download .text-white-50 {
    color: #ffffff !important;
  }
  .app-page-wrapper .qr-container-modern {
    background: #ffffff !important;
    border: 1px solid #e8eef5 !important;
    box-shadow: 0 8px 24px rgba(26,35,50,0.08) !important;
  }
  .app-page-wrapper .qr-container-modern h5,
  .app-page-wrapper .qr-container-modern p {
    color: #1a2332 !important;
  }
  .app-page-wrapper .guide-card-modern,
  .app-page-wrapper .bg-glass-dark,
  .app-page-wrapper .bg-glass {
    background: #ffffff !important;
    border: 1px solid #e8eef5 !important;
  }
  .app-page-wrapper .blob { display: none !important; }
  .app-page-wrapper .mockup-container-modern { display: none !important; }
  .app-page-wrapper .feature-item-modern .icon-box {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Desktop swap keeps dark look */
@media (min-width: 769px) {
  .swap-page .swap-main-card {
    background: #0b0e11 !important;
    border: 1px solid #2b3139 !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5) !important;
  }
  .swap-page .swap-title { color: #fff !important; }
  .swap-page .h5-swap-box {
    background: #161a1e !important;
    border: 1px solid #2b3139 !important;
  }
  .swap-page .h5-swap-box .lbl,
  .swap-page .h5-swap-box .bal { color: rgba(255,255,255,0.55) !important; }
  .swap-page .h5-swap-box .val,
  .swap-page .swap-amt { color: #fff !important; }
  .swap-page .swap-coin-btn {
    background: #0b0e11 !important;
    border-color: #2b3139 !important;
    color: #fff !important;
  }
  .swap-page .h5-swap-meta {
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
  }
  .swap-page .h5-swap-meta .row-line { color: rgba(255,255,255,0.55) !important; }
  .swap-page .h5-swap-meta .val { color: #fff !important; }
  .swap-page .swap-dd {
    background: #1e2329 !important;
  }
  .swap-page .swap-dd .dropdown-item { color: #eaecef !important; }
}

/* Scroll lock on mobile */
html.h5-lock, body.h5-mobile {
  overflow-x: hidden !important;
  overscroll-behavior-x: none;
  max-width: 100vw;
  width: 100%;
}
body.h5-mobile {
  touch-action: pan-y;
}
body.h5-mobile a,
body.h5-mobile button,
body.h5-mobile .btn,
body.h5-mobile [role="button"],
body.h5-mobile .h5-grid-item,
body.h5-mobile .h5-list-item {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
body.h5-mobile,
body.h5-mobile * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
body.h5-mobile *::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
body.h5-mobile .h5-page,
body.h5-mobile main {
  overflow-x: hidden;
  max-width: 100%;
}

/* Splash screen */
body.h5-splash-page {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #d9ebff;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}
.h5-splash-screen {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: #d9ebff;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}
.h5-splash-pure {
  pointer-events: none;
  user-select: none;
}
.h5-splash-pure .h5-splash-bg {
  object-fit: cover;
  object-position: center center;
  background: #d9ebff;
}
.h5-splash-progress-only {
  position: absolute;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(280px, 80vw);
  height: 4px;
  background: rgba(47,107,255,.15);
  border-radius: 999px;
  overflow: hidden;
  z-index: 3;
}
.h5-splash-progress-only span {
  display: block;
  height: 100%;
  width: 35%;
  background: #2f6bff;
  border-radius: 999px;
  animation: h5SplashBar 2.4s ease-in-out infinite;
}
.h5-splash-inline {
  z-index: 20000;
}
.h5-splash-screen.hide { opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.h5-splash-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center center;
}
.h5-splash-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,0) 35%, rgba(255,255,255,.72) 70%, rgba(255,255,255,.95) 100%);
}
.h5-splash-brand {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #1d4ed8;
  margin-bottom: 8px;
}
.h5-splash-title {
  font-size: 18px;
  font-weight: 800;
  color: #1a2332;
  margin: 0 0 6px;
  max-width: 92vw;
}
.h5-splash-sub, .h5-splash-tags {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 8px;
}
.h5-splash-features {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 11px;
  color: #475569;
  margin: 10px 0 16px;
}
.h5-splash-progress {
  width: min(280px, 80vw);
  height: 4px;
  background: rgba(47,107,255,.15);
  border-radius: 999px;
  overflow: hidden;
}
.h5-splash-progress span {
  display: block;
  height: 100%;
  width: 35%;
  background: #2f6bff;
  border-radius: 999px;
  animation: h5SplashBar 2.4s ease-in-out infinite;
}
@keyframes h5SplashBar {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

/* AI chat page fixed layout */
html.h5-chat-lock,
body.h5-support-chat-active,
body.h5-ai-page {
  overflow: hidden !important;
  overscroll-behavior: none;
  height: 100%;
  max-height: 100dvh;
}
body.h5-ai-page,
body.h5-support-chat-active {
  padding-bottom: 0 !important;
  touch-action: none;
}
body.h5-support-chat-active .h5-support-msgs,
body.h5-ai-page .h5-ai-msgs {
  touch-action: pan-y;
}
body.h5-support-chat-active > header,
body.h5-ai-page > header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
}
body.h5-support-chat-active .h5-back-bar,
body.h5-ai-page .h5-back-bar {
  position: fixed !important;
  top: var(--h5-header-h, 56px);
  left: 0;
  right: 0;
  z-index: 1090;
}
body.h5-ai-page > footer,
body.h5-ai-page .mobile-nav { display: none !important; }
.h5-ai-app {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--h5-top-chrome, 106px);
  bottom: 0;
  display: flex;
  flex-direction: column;
  background: #f7f9fc;
  z-index: 900;
}
.h5-ai-msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 12px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.h5-ai-bottom {
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid var(--h5-border);
  padding-bottom: env(safe-area-inset-bottom);
}
body.h5-ai-page .h5-chat-input {
  position: static;
  bottom: auto;
  left: auto;
  right: auto;
}
body.h5-ai-page .h5-chat-quick {
  position: static;
}

/* Support chat — fixed chrome, messages scroll inside only */
body.h5-support-chat-active .h5-support-page {
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.h5-support-page:not(.h5-support-chat-mode) {
  padding-bottom: calc(var(--h5-nav-bg-h, 52px) + env(safe-area-inset-bottom) + 8px) !important;
}
.h5-support-chat {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--h5-top-chrome, 106px);
  bottom: calc(var(--h5-nav-bg-h, 52px) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  background: #f7f9fc;
  z-index: 900;
}
.h5-support-intro {
  text-align: center;
  padding: 16px 16px 8px;
}
.h5-support-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #eaf1ff;
  color: #2f6bff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.h5-support-intro h2 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.h5-support-intro p { font-size: 13px; color: var(--h5-muted); margin-bottom: 12px; }
.h5-support-tips {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  text-align: left;
  font-size: 12px;
  color: var(--h5-muted);
}
.h5-support-tips li { padding: 6px 0; border-bottom: 1px solid var(--h5-border); }
.h5-support-form {
  padding: 0 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.h5-support-form label { font-size: 12px; font-weight: 700; color: var(--h5-text); margin-top: 6px; }
.h5-support-form input,
.h5-support-form select {
  border-radius: 12px !important;
  padding: 12px 14px !important;
  border: 1px solid var(--h5-border) !important;
}
.h5-support-enter {
  margin-top: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--h5-primary);
  color: #fff;
  font-weight: 800;
  padding: 14px;
}
.h5-support-chat-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid var(--h5-border);
}
.h5-support-chat-head .dot {
  width: 10px; height: 10px; border-radius: 50%; background: #16a34a;
}
.h5-support-msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}
.h5-support-msg {
  display: flex;
  width: 100%;
  margin-bottom: 12px;
}
.h5-support-msg.user {
  justify-content: flex-end;
}
.h5-support-msg.bot {
  justify-content: flex-start;
}
.h5-support-msg-inner {
  max-width: 78%;
  display: flex;
  flex-direction: column;
}
.h5-support-msg.user .h5-support-msg-inner {
  align-items: flex-end;
}
.h5-support-msg.bot .h5-support-msg-inner {
  align-items: flex-start;
}
.h5-support-msg .bubble {
  background: #fff;
  border: 1px solid var(--h5-border);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.h5-support-msg.user .bubble {
  background: var(--h5-primary);
  color: #fff;
  border: 0;
  border-radius: 14px 14px 4px 14px;
}
.h5-support-msg.bot .bubble {
  border-radius: 14px 14px 14px 4px;
}
.h5-support-time {
  margin-top: 4px;
  padding: 0 2px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--h5-muted);
}
.h5-support-msg.user .h5-support-time {
  text-align: right;
}
.h5-support-msg.bot .h5-support-time {
  text-align: left;
}
.h5-support-input {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #fff;
  border-top: 1px solid var(--h5-border);
  overflow: hidden;
}
.h5-support-file-hidden {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.h5-support-img-btn {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--h5-border);
  background: #fff;
  color: var(--h5-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.h5-support-input input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  width: 0;
  height: 40px;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 20px !important;
  padding: 0 12px !important;
  border: 1px solid var(--h5-border) !important;
  background: #f5f8fc !important;
}
.h5-support-send-btn,
.h5-support-input > button[type="submit"] {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--h5-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 16px;
}
.h5-support-msg .bubble.bubble-image {
  padding: 4px;
  background: transparent;
  border: 0;
}
.h5-support-msg.user .bubble.bubble-image {
  background: transparent;
}
.h5-support-msg .bubble .h5-support-img {
  max-width: min(220px, 72vw);
  max-height: 200px;
  border-radius: 10px;
  display: block;
  object-fit: cover;
  cursor: pointer;
}
.h5-support-upload-sheet {
  position: fixed;
  inset: 0;
  z-index: 12000;
}
.h5-support-upload-sheet[hidden] {
  display: none !important;
}
.h5-support-upload-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.h5-support-upload-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.h5-support-upload-panel button {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  color: var(--h5-text);
  font-size: 16px;
  font-weight: 600;
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid var(--h5-border);
  touch-action: manipulation;
}
.h5-support-upload-panel button.cancel {
  color: var(--h5-muted);
  border-bottom: 0;
  margin-top: 6px;
}