  :root{
    --bg:#14171A;
    --surface:#1E2227;
    --surface-2:#262B31;
    --line:#333941;
    --copper:#C97B3E;
    --copper-dim:#8C5A2E;
    --steel:#4A7C9E;
    --steel-dim:#345A73;
    --text:#EAEAE6;
    --text-mute:#9198A0;
    --danger:#C25450;
    --ok:#5FA672;
    --toast-bg:#FFFFFF;
    --toast-text:#172129;
    --toast-border:#172129;
    --toast-shadow:rgba(0,0,0,.42);
    --radius:14px;
  }
  *{box-sizing:border-box; margin:0; padding:0;}
  html,body{height:100%;}
  body{
    background:var(--bg);
    color:var(--text);
    font-family:'Inter',sans-serif;
    -webkit-font-smoothing:antialiased;
    overflow:hidden;
  }
  h1,h2,h3,.display{font-family:'Archivo',sans-serif; letter-spacing:-0.01em;}
  .mono{font-family:'JetBrains Mono',monospace;}

  /* ---- App shell (full-bleed on mobile, and now full màn hình trên desktop luôn) ---- */
  #shell-wrap{
    height:100vh; height:100dvh; width:100%;
    display:flex; align-items:center; justify-content:center;
    background:#0A0B0C;
    padding:0;
  }
  #app{
    position:relative;
    width:100%; max-width:430px; height:100vh; height:100dvh; max-height:100vh; max-height:100dvh;
    background:var(--bg);
    display:flex; flex-direction:column;
    overflow:hidden;
    box-shadow:0 0 60px rgba(0,0,0,.6);
  }
  @media (min-width:431px){
    #app{max-width:100%; height:100vh; height:100dvh; max-height:100vh; max-height:100dvh; border-radius:0; border:none; box-shadow:none;}
  }

  /* ---- Top bar ---- */
  .topbar{
    display:flex; align-items:center; justify-content:space-between;
    padding:14px 16px 10px;
    flex-shrink:0;
  }
  .brand{display:flex; align-items:center; gap:10px;}
  .brand-mark{
    width:46px; height:46px; border-radius:10px;
    background:linear-gradient(135deg,var(--copper),var(--copper-dim));
    display:flex; align-items:center; justify-content:center;
    font-family:'Archivo',sans-serif; font-weight:800; font-size:15px; color:#151515;
    clip-path:polygon(0 0,100% 0,100% 75%,75% 100%,0 100%);
    flex-shrink:0;
  }
  .brand-mark.has-logo{
    background:#fff; border:1.5px solid #D5DADF;
    box-shadow:0 3px 10px rgba(20,27,32,.18);
    clip-path:none; padding:4px; overflow:hidden;
  }
  .brand-mark.has-logo img{
    width:100%; height:100%; object-fit:contain; object-position:center;
    display:block; border-radius:6px;
  }
  .brand-name{font-size:14.5px; font-weight:700; line-height:1.1;}
  .brand-sub{font-size:10.5px; color:var(--text-mute); font-family:'JetBrains Mono',monospace;}
  .icon-btn{
    width:36px; height:36px; border-radius:50%;
    background:var(--surface); border:1px solid var(--line);
    display:flex; align-items:center; justify-content:center;
    color:var(--text); cursor:pointer; position:relative; flex-shrink:0;
  }
  .icon-btn .dot{
    position:absolute; top:6px; right:6px; width:7px; height:7px; border-radius:50%;
    background:var(--danger); border:1.5px solid var(--bg);
  }
  .topbar-avatar{
    width:100%; height:100%; border-radius:50%;
    background:linear-gradient(135deg,var(--copper),var(--copper-dim));
    display:flex; align-items:center; justify-content:center;
    font-size:11.5px; font-weight:800; color:#151515; overflow:hidden;
  }
  .avatar-edit-wrap{position:relative; cursor:pointer; flex-shrink:0;}
  .avatar-edit-wrap .avatar{overflow:hidden;}
  .avatar-edit-badge{
    position:absolute; right:-2px; bottom:-2px; width:21px; height:21px; border-radius:50%;
    display:flex; align-items:center; justify-content:center; background:var(--copper); color:#171717;
    border:2px solid var(--bg); font-size:12px; font-weight:800;
  }
  .icon-btn .online-dot{
    position:absolute; top:-1px; right:-1px; width:11px; height:11px; border-radius:50%;
    background:#3fbf6a; border:2px solid var(--bg);
  }
  .nav-item .online-dot{
    position:absolute; top:-2px; right:26%; width:8px; height:8px; border-radius:50%;
    background:#3fbf6a; border:1.5px solid var(--bg);
  }

  /* ---- Views ---- */
  .view{
    display:none; flex-direction:column; flex:1; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch;
    padding-bottom:14px;
  }
  .view.active{display:flex;}
  .view::-webkit-scrollbar{display:none;}

  .section{padding:14px 16px;}
  .section-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px;}
  .section-title{font-size:15px; font-weight:700;}
  .link-mute{font-size:12px; color:var(--copper); cursor:pointer;}

  /* ---- Business intro card ---- */
  .intro-card{
    margin:0 16px 4px; padding:18px;
    border-radius:var(--radius);
    background:linear-gradient(160deg,#232830,#181B1F 70%);
    border:1px solid var(--line);
    position:relative; overflow:hidden; flex-shrink:0;
  }
  .intro-card::after{
    content:"";
    position:absolute; right:-30px; top:-30px; width:120px; height:120px;
    background:radial-gradient(circle,rgba(201,123,62,.18),transparent 70%);
  }
  .intro-tag{
    display:inline-block; font-family:'JetBrains Mono',monospace; font-size:10px;
    color:var(--copper); border:1px solid var(--copper-dim); border-radius:20px;
    padding:3px 9px; margin-bottom:10px; letter-spacing:.04em;
  }
  .intro-card h2{font-size:19px; line-height:1.3; margin-bottom:6px;}
  .intro-card p{font-size:12.5px; color:var(--text-mute); line-height:1.5; margin-bottom:12px;}
  .intro-stats{display:flex; gap:16px;}
  .intro-stat b{display:block; font-size:16px; font-family:'Archivo',sans-serif;}
  .intro-stat span{font-size:10px; color:var(--text-mute);}

  /* ---- Ad carousel ---- */
  .ad-strip{
    display:flex; gap:10px; overflow-x:auto; padding:14px 16px 4px; scroll-snap-type:x mandatory;
  }
  .ad-strip::-webkit-scrollbar{display:none;}
  .ad-card{
    flex:0 0 82%; scroll-snap-align:start;
    height:96px; border-radius:12px;
    display:flex; align-items:center; justify-content:space-between; padding:14px;
    position:relative; overflow:hidden; cursor:pointer;
  }
  .ad-card.a1{background:linear-gradient(120deg,#3A5568,#1E2227);}
  .ad-card.a2{background:linear-gradient(120deg,#7A4A26,#1E2227);}
  .ad-card.a3{background:linear-gradient(120deg,#3F5F3F,#1E2227);}
  .ad-label{
    position:absolute; top:8px; right:10px; font-family:'JetBrains Mono',monospace;
    font-size:8.5px; color:rgba(255,255,255,.5); border:1px solid rgba(255,255,255,.25);
    padding:1px 6px; border-radius:20px;
  }
  .ad-card h4{font-size:14px; font-weight:700; max-width:70%;}
  .ad-card span{font-size:10.5px; color:rgba(255,255,255,.7);}
  .ad-cta{
    font-size:10.5px; font-weight:700; background:rgba(255,255,255,.14);
    padding:5px 10px; border-radius:8px; white-space:nowrap;
  }

  /* ---- Category chips ---- */
  .chip-row{display:flex; align-items:center; gap:8px; overflow-x:auto; overflow-y:visible; padding:12px 16px 4px; min-height:46px; flex-shrink:0;}
  .chip-row::-webkit-scrollbar{display:none;}
  .chip{
    flex:0 0 auto; font-size:12px; line-height:1.3; padding:8px 13px; border-radius:20px;
    background:var(--surface); border:1px solid var(--line); color:var(--text-mute); cursor:pointer;
    white-space:nowrap; display:flex; align-items:center;
  }
  .chip.active{background:var(--copper); border-color:var(--copper); color:#161616; font-weight:700;}

  /* ---- Product grid ---- */
  .product-grid{display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:12px 16px;}
  .p-card{
    background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
    overflow:hidden; cursor:pointer; clip-path:polygon(0 0,100% 0,100% 92%,92% 100%,0 100%);
  }
  .p-thumb{
    height:96px; display:flex; align-items:center; justify-content:center; position:relative;
    font-family:'JetBrains Mono',monospace; font-size:11px; color:rgba(255,255,255,.55);
  }
  .p-thumb .product-slide{
    position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
    opacity:0; transform:scale(1.02); transition:opacity .7s ease, transform 3.8s ease;
  }
  .p-thumb .product-slide.active{opacity:1; transform:scale(1);}
  .p-thumb .vid-badge{
    position:absolute; bottom:6px; right:6px; width:20px; height:20px; border-radius:50%;
    background:rgba(0,0,0,.55); display:flex; align-items:center; justify-content:center; z-index:2;
  }
  @media (prefers-reduced-motion:reduce){.p-thumb .product-slide{transition:none;}}
  .p-body{padding:10px 10px 12px;}
  .p-name{font-size:12.5px; font-weight:600; line-height:1.3; margin-bottom:4px; min-height:32px;}
  .p-spec{font-family:'JetBrains Mono',monospace; font-size:9.5px; color:var(--text-mute); margin-bottom:6px;}
  .p-price-row{display:flex; align-items:center; justify-content:space-between;}
  .p-price{font-size:13.5px; font-weight:700; color:var(--copper);}
  .p-add{
    width:26px; height:26px; border-radius:50%; background:var(--surface-2); border:1px solid var(--line);
    display:flex; align-items:center; justify-content:center; color:var(--text);
  }

  /* ---- Bottom nav ---- */
  .bottomnav{
    flex-shrink:0; display:flex; border-top:1px solid var(--line);
    background:rgba(20,23,26,.96); backdrop-filter:blur(8px);
    padding:8px 4px calc(8px + env(safe-area-inset-bottom));
  }
  .nav-item{
    flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
    color:var(--text-mute); cursor:pointer; font-size:9.5px; position:relative;
  }
  .nav-item.active{color:var(--copper);}
  .nav-item .badge{
    position:absolute; top:-3px; right:22%; background:var(--danger); color:#fff;
    font-size:8px; min-width:14px; height:14px; border-radius:7px; display:flex; align-items:center; justify-content:center; padding:0 3px;
  }

  /* ---- Chat list ---- */
  .tab-row{display:flex; gap:6px; padding:10px 16px 4px;}
  .tab-btn{
    flex:1; text-align:center; padding:8px 0; border-radius:10px; font-size:12.5px; font-weight:600;
    background:var(--surface); color:var(--text-mute); cursor:pointer; border:1px solid var(--line);
  }
  .tab-btn.active{background:var(--steel); color:#fff; border-color:var(--steel);}
  .conv-item{
    display:flex; gap:11px; padding:11px 16px; align-items:center; cursor:pointer;
    border-bottom:1px solid var(--line);
  }
  .avatar{
    width:44px; height:44px; border-radius:50%; flex-shrink:0;
    background:linear-gradient(135deg,var(--steel),#2c3d47);
    display:flex; align-items:center; justify-content:center; font-weight:700; font-size:15px;
  }
  .avatar.group{background:linear-gradient(135deg,var(--copper),#5a3a20); border-radius:14px;}
  .avatar-wrap{position:relative; flex-shrink:0;}
  .presence-dot{
    position:absolute; bottom:0px; right:0px; width:11px; height:11px; border-radius:50%;
    border:2px solid var(--bg);
  }
  .presence-dot.online{background:#3fbf6a;}
  .presence-dot.offline{background:#7a7f85;}
  .conv-info{flex:1; min-width:0;}
  .conv-top{display:flex; justify-content:space-between; align-items:baseline;}
  .conv-name{font-size:13.5px; font-weight:600;}
  .conv-time{font-size:10px; color:var(--text-mute);}
  .conv-msg{font-size:12px; color:var(--text-mute); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:220px;}
  .unread{
    background:var(--copper); color:#161616; font-size:10px; font-weight:700;
    min-width:18px; height:18px; border-radius:9px; display:flex; align-items:center; justify-content:center; padding:0 4px;
  }

  /* ---- Chat thread ---- */
  #chatThreadView{padding:0;}
  .thread-head{
    display:flex; align-items:center; gap:10px; padding:12px 14px; border-bottom:1px solid var(--line); flex-shrink:0;
  }
  .thread-actions{display:flex; gap:8px; margin-left:auto;}
  .msgs{flex:1; overflow-y:auto; padding:14px 6px 6px; display:flex; flex-direction:column; gap:8px;}
  .msg-row{display:flex; width:100%;}
  .msg-row.me{justify-content:flex-end;}
  .msg-column{display:flex; flex-direction:column; align-items:flex-start; max-width:76%; min-width:0;}
  .msg-row.me .msg-column{align-items:flex-end;}
  .bubble{
    width:fit-content; max-width:100%; padding:9px 12px; border-radius:14px; font-size:13px; line-height:1.4;
    overflow-wrap:anywhere;
  }
  .msg-row.me .bubble{background:var(--copper); color:#161616; border-bottom-right-radius:4px;}
  .msg-row.other .bubble{background:var(--surface-2); border-bottom-left-radius:4px;}
  .img-broken{
    max-width:180px; padding:10px; border-radius:10px; margin-bottom:6px; cursor:pointer;
    background:rgba(255,255,255,0.08); font-size:11px; line-height:1.4; text-decoration:underline;
  }
  .msg-time{width:max-content; max-width:100%; font-size:9px; color:var(--text-mute); margin-top:3px;}
  .msg-actions{display:inline-flex; flex-wrap:wrap; gap:3px; margin:3px 0 0 4px; vertical-align:middle;}
  .msg-act-btn{
    display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding:0 4px;
    border:1px solid var(--line); border-radius:5px; background:var(--surface); color:var(--text);
    cursor:pointer; opacity:1; font-size:8px; font-weight:700; line-height:1; touch-action:manipulation;
  }
  .msg-act-btn-primary{background:var(--copper); border-color:var(--copper); color:#161616; min-width:42px; gap:2px;}
  .msg-like-wrap{display:inline-flex; align-items:center; height:20px; border:1px solid var(--line); border-radius:5px; overflow:hidden; background:var(--surface);}
  .msg-like-btn{font-size:9px; min-width:20px; height:18px; border:0; border-radius:0; padding:0 3px; background:transparent; color:var(--text);}
  .msg-like-btn.active{background:#1877f2; border-color:#1877f2; color:#fff; box-shadow:0 0 0 1px rgba(24,119,242,.22);}
  .msg-like-btn[data-busy="1"]{opacity:.65; pointer-events:none;}
  .msg-like-count{display:inline-flex; align-items:center; justify-content:center; min-width:17px; height:18px; padding:0 3px; border-left:1px solid var(--line); color:#1877f2; font-size:8px; font-weight:800; cursor:pointer;}
  .msg-like-summary{display:inline-flex; align-items:center; height:20px; padding:0 5px; border:1px solid var(--line); border-radius:5px; background:var(--surface); color:#1877f2; font-size:8px; font-weight:800; cursor:pointer;}
  .message-likes-list{margin-top:12px;}
  .message-like-person{display:flex; align-items:center; gap:9px; padding:9px 2px; border-bottom:1px solid var(--line); font-size:12px; font-weight:600;}
  .message-like-person:last-child{border-bottom:0;}
  .attachment-viewer-sheet{height:92%; max-height:92%;}
  .attachment-viewer-head{display:flex; align-items:center; gap:10px; padding:12px 14px 8px; border-bottom:1px solid var(--line);}
  .attachment-viewer-head .pd-title{font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin:0;}
  .attachment-viewer-status{font-size:10px; color:var(--text-mute); margin-top:3px;}
  .attachment-viewer-tabs{display:flex; gap:6px; overflow-x:auto; padding:7px 10px; border-bottom:1px solid var(--line);}
  .attachment-viewer-tab{flex:0 0 auto; padding:5px 9px; border:1px solid var(--line); border-radius:7px; background:var(--surface); color:var(--text); font-size:10px; cursor:pointer;}
  .attachment-viewer-tab.active{background:var(--copper); border-color:var(--copper); color:#161616; font-weight:700;}
  .attachment-viewer-body{flex:1; min-height:0; overflow:auto; padding:10px; background:var(--bg);}
  .attachment-viewer-body iframe{width:100%; height:100%; min-height:520px; border:0; background:#fff;}
  .attachment-viewer-body table{border-collapse:collapse; min-width:100%; background:var(--surface); font-size:11px;}
  .attachment-viewer-body th,.attachment-viewer-body td{border:1px solid var(--line); padding:5px 7px; text-align:left; max-width:280px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .attachment-viewer-body th{position:sticky; top:0; background:var(--surface-2); z-index:1;}
  .attachment-viewer-body .docx-preview{max-width:760px; margin:auto; padding:18px; background:#fff; color:#161616; min-height:100%; line-height:1.55;}
  .attachment-viewer-body .docx-preview img{max-width:100%; height:auto;}
  .attachment-viewer-body .docx-preview table{color:#161616; background:#fff;}
  .attachment-viewer-body canvas{display:block; width:100%; height:100%; min-height:500px; touch-action:none;}
  .attachment-viewer-actions{gap:8px; justify-content:flex-end;}
  .attachment-file-actions{display:flex; gap:5px; margin-top:7px;}
  .attachment-file-action{display:inline-flex; align-items:center; justify-content:center; min-height:25px; padding:4px 7px; border:1px solid var(--line); border-radius:6px; background:var(--surface); color:var(--text); text-decoration:none; font-size:9px; font-weight:700; cursor:pointer;}
  .msg-act-btn:active{transform:scale(.95); filter:brightness(.92);}
  .msg-act-btn svg{width:8px; height:8px;}
  .composer{
    display:flex; gap:8px; padding:10px 12px; border-top:1px solid var(--line); flex-shrink:0; align-items:center;
  }
  #attachPreviewBar,#adminAttachPreviewBar{max-height:210px; overflow-y:auto;}
  .composer input{
    flex:1; background:var(--surface); border:1px solid var(--line); border-radius:20px;
    padding:10px 14px; color:var(--text); font-size:13px; outline:none;
  }
  .mention-picker{display:none; max-height:190px; overflow:auto; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 8px 24px rgba(0,0,0,.16); margin:0 12px 6px; padding:5px; flex-shrink:0;}
  .mention-row{display:flex; align-items:center; gap:9px; padding:8px; border-radius:9px; cursor:pointer;}
  .mention-row:active{background:var(--surface-2);}
  .send-btn{
    width:38px; height:38px; border-radius:50%; background:var(--copper); border:none;
    display:flex; align-items:center; justify-content:center; color:#161616; cursor:pointer; flex-shrink:0;
  }

  /* ---- Video call ---- */
  .call-list-item{display:flex; align-items:center; gap:11px; padding:11px 16px; border-bottom:1px solid var(--line);}
  .call-dir{font-size:11px; display:flex; align-items:center; gap:4px; margin-top:2px;}
  .call-dir.miss{color:var(--danger);}
  .call-btn-sm{
    width:36px; height:36px; border-radius:50%; background:var(--surface-2); border:1px solid var(--line);
    display:flex; align-items:center; justify-content:center; color:var(--ok); cursor:pointer; margin-left:auto;
  }
  /* Màn hình gọi luôn dùng giao diện tối cố định, không phụ thuộc màu nền do doanh
     nghiệp tự chọn (applyAppBackground có thể đổi --text/--text-mute/--surface-2/--line
     sang tông sáng cho toàn app) -> nếu không ghim lại ở đây, chữ tối sẽ chìm vào nền
     tối #0D0F11 và gần như không đọc được (tên người gọi, đồng hồ, nút điều khiển). */
  #view-callscreen{
    padding:0; background:#0D0F11; color:#EAEAE6;
    /* Thiếu --text ở đây là nguyên nhân icon nút mic/camera/đổi camera (dùng stroke="currentColor"
       ăn theo var(--text)) bị chìm mất khi doanh nghiệp chọn nền sáng: --text toàn app khi đó đổi
       thành màu tối, vẽ icon tối lên nền tròn --surface-2 cũng tối -> gần như vô hình. Nút loa/cúp
       máy không bị vì có màu chữ #fff cố định riêng (xem .ctrl-btn.on/.end bên dưới). */
    --text:#EAEAE6; --text-mute:#9198A0; --surface-2:#262B31; --line:#333941;
  }
  .call-stage{
    flex:1; position:relative; display:flex; align-items:center; justify-content:center; min-height:0;
  }
  .call-stage.group{display:grid; grid-template-columns:1fr 1fr; gap:6px; padding:6px;}
  .call-tile{
    width:100%; height:100%; border-radius:14px; background:linear-gradient(160deg,#26303a,#161b20);
    display:flex; flex-direction:column; align-items:center; justify-content:center; position:relative; overflow:hidden;
  }
  .call-tile .avatar{width:64px; height:64px; font-size:22px; margin-bottom:8px;}
  .call-tile .cname{font-size:12.5px; font-weight:600;}
  .call-tile .cstat{font-size:10px; color:var(--text-mute); font-family:'JetBrains Mono',monospace;}
  .call-stage.group .call-tile{aspect-ratio:1;}
  .call-stage.group .call-tile .avatar{width:44px; height:44px; font-size:16px;}
  .self-pip{
    position:absolute; bottom:14px; right:14px; width:84px; height:112px; border-radius:10px;
    background:#20262c; border:1px solid var(--line); display:flex; align-items:center; justify-content:center;
    font-size:9px; color:var(--text-mute); text-align:center; padding:6px;
  }
  .call-timer{
    position:absolute; top:14px; left:50%; transform:translateX(-50%); z-index:6;
    font-family:'JetBrains Mono',monospace; font-size:15px; font-weight:700; letter-spacing:.5px;
    background:rgba(0,0,0,.45); padding:5px 14px; border-radius:20px;
  }
  .ringing-overlay{
    position:absolute; inset:0; z-index:5; display:flex; flex-direction:column; align-items:center; justify-content:center;
    background:linear-gradient(160deg,#26303a,#161b20); border-radius:14px; text-align:center; padding:20px; gap:5px;
  }
  .ringing-overlay .avatar{margin-bottom:6px;}
  .ringing-name{font-size:19px; font-weight:700;}
  .ringing-status{
    font-size:12.5px; color:var(--text-mute); font-family:'JetBrains Mono',monospace;
    display:flex; align-items:center; gap:6px;
  }
  .ring-dot{width:7px; height:7px; border-radius:50%; background:var(--copper); animation:ringPulse 1s ease-in-out infinite;}
  @keyframes ringPulse{0%,100%{opacity:.25;} 50%{opacity:1;}}
  .call-controls{
    display:flex; justify-content:center; gap:16px; padding:20px 16px calc(20px + env(safe-area-inset-bottom));
    flex-shrink:0;
  }
  .ctrl-btn{
    width:52px; height:52px; border-radius:50%; background:var(--surface-2); border:1px solid var(--line);
    display:flex; align-items:center; justify-content:center; color:var(--text); cursor:pointer;
  }
  .ctrl-btn.off{background:var(--danger); border-color:var(--danger); color:#fff;}
  .ctrl-btn.on{background:var(--copper); border-color:var(--copper); color:#fff;}
  .ctrl-btn.end{background:var(--danger); border-color:var(--danger); color:#fff;}
  .demo-badge{
    font-family:'JetBrains Mono',monospace; font-size:9px; color:var(--text-mute);
    text-align:center; padding:6px; border-top:1px dashed var(--line);
  }

  /* ---- Product detail / modal ---- */
  .modal-bg{
    position:absolute; inset:0; background:rgba(0,0,0,.55); z-index:50; display:none;
    align-items:flex-end; justify-content:center;
  }
  .modal-bg.active{display:flex;}
  .sheet{
    width:100%; max-height:88%; background:var(--bg); border-radius:20px 20px 0 0;
    display:flex; flex-direction:column; overflow:hidden; animation:slideUp .25s ease;
  }
  @keyframes slideUp{from{transform:translateY(40px); opacity:0;} to{transform:translateY(0); opacity:1;}}
  .sheet-drag{width:36px; height:4px; background:var(--line); border-radius:3px; margin:10px auto 4px;}
  .sheet-body{overflow-y:auto; padding-bottom:10px;}
  .gallery{display:flex; gap:0; overflow-x:auto; padding:0; scroll-snap-type:x mandatory;}
  .gallery::-webkit-scrollbar{display:none;}
  .gallery-wrap{position:relative;}
  .gallery-nav{
    display:none; position:absolute; top:50%; transform:translateY(-50%);
    width:38px; height:38px; border-radius:50%; background:rgba(0,0,0,.5); color:#fff;
    align-items:center; justify-content:center; cursor:pointer; font-size:22px; line-height:1;
    z-index:5; user-select:none;
  }
  .gallery-nav:hover{background:rgba(0,0,0,.75);}
  .gallery-nav-prev{left:12px;}
  .gallery-nav-next{right:12px;}
  .gallery-item{
    flex:0 0 100%; width:100%; height:260px; border-radius:0; scroll-snap-align:center;
    display:flex; align-items:center; justify-content:center; position:relative;
    font-family:'JetBrains Mono',monospace; font-size:12px; color:rgba(255,255,255,.6);
  }
  .gallery-item .play{
    position:absolute; width:44px; height:44px; border-radius:50%; background:rgba(0,0,0,.5);
    display:flex; align-items:center; justify-content:center;
  }
  .pd-body{padding:6px 18px 4px;}
  .pd-title{font-size:18px; font-weight:700; margin-bottom:6px;}
  .pd-price{font-size:20px; font-weight:800; color:var(--copper); font-family:'Archivo',sans-serif;}
  .pd-desc{font-size:12.5px; color:var(--text-mute); line-height:1.6; margin-bottom:14px;}
  .qty-row{display:flex; align-items:center; gap:14px; margin-bottom:16px;}
  .qty-btn{
    width:32px; height:32px; border-radius:8px; background:var(--surface); border:1px solid var(--line);
    display:flex; align-items:center; justify-content:center; cursor:pointer;
  }
  .sheet-actions{
    display:flex; gap:10px; padding:12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top:1px solid var(--line); flex-shrink:0;
  }
  .btn{
    flex:1; padding:13px; border-radius:12px; text-align:center; font-weight:700; font-size:13.5px;
    cursor:pointer; border:1px solid transparent;
  }
  .btn-outline{background:transparent; border-color:var(--copper); color:var(--copper);}
  .btn-solid{background:var(--copper); color:#161616;}
  .bg-color-options{display:flex; gap:9px; align-items:center; flex-wrap:wrap; margin-top:6px;}
  .bg-color-swatch{width:34px; height:34px; border-radius:50%; border:2px solid var(--line); cursor:pointer; box-shadow:inset 0 0 0 2px rgba(255,255,255,.08);}
  .bg-color-swatch.active{outline:2px solid var(--copper); outline-offset:2px;}
  .bg-color-picker{width:42px; height:34px; border:1px solid var(--line); background:var(--surface); border-radius:8px; padding:3px; cursor:pointer;}
  .btn-full{width:100%;}

  /* ---- Checkout / order confirm ---- */
  .order-line{display:flex; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); align-items:center;}
  .order-thumb{width:48px; height:48px; border-radius:8px; flex-shrink:0; background:var(--surface-2);}
  .order-line-name{font-size:12.5px; font-weight:600;}
  .order-line-sub{font-size:11px; color:var(--text-mute);}
  .form-group{margin-bottom:12px;}
  .form-group label{font-size:11.5px; color:var(--text-mute); display:block; margin-bottom:5px;}
  .form-group input, .form-group textarea{
    width:100%; background:var(--surface); border:1px solid var(--line); border-radius:10px;
    padding:10px 12px; color:var(--text); font-size:13px; font-family:'Inter',sans-serif; outline:none;
  }
  .pass-wrap{position:relative;}
  .pass-wrap input{padding-right:40px !important;}
  .pass-eye{
    position:absolute; right:4px; top:50%; transform:translateY(-50%);
    width:32px; height:32px; display:flex; align-items:center; justify-content:center;
    color:var(--text-mute); cursor:pointer; background:none; border:none;
  }
  .pay-option{
    display:flex; align-items:center; gap:10px; padding:12px; border:1px solid var(--line); border-radius:12px; margin-bottom:8px; cursor:pointer;
  }
  .pay-option.selected{border-color:var(--copper); background:rgba(201,123,62,.08);}
  .pay-icon{
    width:34px; height:34px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:800;
  }
  .sum-row{display:flex; justify-content:space-between; font-size:12.5px; padding:5px 0; color:var(--text-mute);}
  .sum-row.total{color:var(--text); font-weight:700; font-size:14.5px; padding-top:10px; border-top:1px solid var(--line); margin-top:6px;}

  /* success screen */
  .success-wrap{display:flex; flex-direction:column; align-items:center; justify-content:center; padding:40px 24px; text-align:center; flex:1;}
  .success-icon{
    width:76px; height:76px; border-radius:50%; background:rgba(95,166,114,.15); border:2px solid var(--ok);
    display:flex; align-items:center; justify-content:center; margin-bottom:18px;
  }

  /* Profile */
  .profile-head{display:flex; align-items:center; gap:14px; padding:18px 16px;}
  .profile-head .avatar{width:58px; height:58px; font-size:20px;}
  .prof-name{font-size:16px; font-weight:700;}
  .prof-role{font-size:11.5px; color:var(--text-mute);}
  .pi-card{
    margin:6px 16px 14px; padding:14px; border-radius:12px;
    background:linear-gradient(120deg,rgba(201,123,62,.16),rgba(74,124,158,.12));
    border:1px solid var(--copper-dim); display:flex; align-items:center; gap:12px;
  }
  .pi-mark{
    width:36px; height:36px; border-radius:50%; background:var(--copper); color:#161616;
    display:flex; align-items:center; justify-content:center; font-weight:800; font-size:15px; flex-shrink:0;
  }
  .menu-row{display:flex; align-items:center; gap:12px; padding:13px 16px; border-bottom:1px solid var(--line); cursor:pointer;}
  .menu-row span{flex:1; font-size:13px;}
  .call-settings-sheet{max-height:78%;}
  .call-settings-body{padding-top:8px;}
  .call-settings-title{font-size:17px; margin-bottom:10px;}
  .call-setting-row{display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 0; border-bottom:1px solid var(--line);}
  .call-setting-label{font-size:13px; font-weight:700;}
  .call-setting-note{font-size:10.5px; color:var(--text-mute); margin-top:3px; line-height:1.4;}
  .setting-switch{position:relative; width:46px; height:26px; flex:0 0 46px; cursor:pointer;}
  .setting-switch input{position:absolute; opacity:0; pointer-events:none;}
  .setting-switch span{position:absolute; inset:0; border-radius:20px; background:var(--line); transition:.18s;}
  .setting-switch span::after{content:""; position:absolute; width:20px; height:20px; top:3px; left:3px; border-radius:50%; background:#fff; box-shadow:0 1px 4px rgba(0,0,0,.28); transition:.18s;}
  .setting-switch input:checked + span{background:var(--copper);}
  .setting-switch input:checked + span::after{transform:translateX(20px);}
  .call-setting-select{padding:14px 0 8px;}
  .call-setting-select label{display:block; font-size:12px; font-weight:700; margin-bottom:7px;}
  .call-setting-select select{width:100%; background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:11px 12px; color:var(--text); font-size:13px;}
  .call-setting-select-grid{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
  .call-settings-warning{font-size:10.5px; color:var(--text-mute); line-height:1.5; padding:7px 0 2px;}
  .note-box{
    margin:14px 16px; padding:12px; border:1px dashed var(--line); border-radius:10px;
    font-size:11px; color:var(--text-mute); line-height:1.6;
  }
  .note-box b{color:var(--steel);}
  input[type="file"]{
    color:var(--text-mute); font-size:11.5px; width:100%;
  }
  input[type="file"]::file-selector-button{
    background:var(--surface-2); border:1px solid var(--line); color:var(--text);
    border-radius:8px; padding:7px 12px; font-size:11.5px; margin-right:10px; cursor:pointer;
  }

  .toast{
    position:absolute; bottom:90px; left:50%; transform:translateX(-50%);
    width:max-content; max-width:min(88%,560px); text-align:center;
    background:var(--toast-bg); color:var(--toast-text); border:2px solid var(--toast-border);
    box-shadow:0 6px 22px var(--toast-shadow); padding:10px 17px; border-radius:20px;
    font-size:12.5px; font-weight:700; line-height:1.45; z-index:80; opacity:0;
    transition:opacity .25s, bottom .25s; pointer-events:none;
  }
  .toast.show{opacity:1; bottom:100px;}

  svg{display:block;}

  /* ---- Bố cục desktop (đặt cuối file để chắc chắn thắng các rule mobile phía trên khi trùng thuộc tính) ---- */
  @media (min-width:431px){
    .topbar, .chip-row, .tab-row, .ad-strip, .intro-card, .section, .product-grid, .section-head{
      width:100%; max-width:920px; margin-left:auto; margin-right:auto;
    }
    /* Lưới sản phẩm: nhiều cột hơn thay vì chỉ 2 thẻ kéo dãn to bản */
    .product-grid{grid-template-columns:repeat(auto-fill, minmax(190px,1fr));}
    .p-thumb{height:150px;}
    /* Thanh điều hướng dưới: gói gọn giữa màn hình, không dàn 3 mục ra sát 2 mép */
    .bottomnav{justify-content:center; gap:8px;}
    .bottomnav > .nav-item{flex:0 0 auto; width:120px;}

    /* Logo, tên công ty, địa chỉ: tăng gấp đôi trên desktop */
    .brand-mark{width:76px; height:76px; border-radius:16px; font-size:30px;}
    .brand-mark.has-logo{padding:6px; border-width:2px; box-shadow:0 5px 16px rgba(20,27,32,.2);}
    .brand-name{font-size:29px;}
    .brand-sub{font-size:21px;}
    /* Ô chữ giới thiệu công ty (Công ty Su Hu cung cấp...): tăng gấp đôi */
    .intro-tag{font-size:20px; padding:6px 18px; border-radius:28px;}

    /* Khung xem chi tiết sản phẩm (bottom sheet trên mobile) -> hộp thoại canh giữa màn hình trên desktop */
    .modal-bg{align-items:center;}
    .sheet{width:100%; max-width:560px; border-radius:20px; max-height:80vh !important;}
    .sheet-drag{display:none;}
    .gallery-item{flex:0 0 100%; width:100%; height:420px;}
    .gallery-nav{display:flex;}
  }
