    /* ===================================================================== */
    /* 3. MODAL 3 TÙY CHỌN (KHÁCH / ĐĂNG NHẬP / ĐĂNG KÝ) + HỒ SƠ CÁ NHÂN    */
    /* ===================================================================== */
    #modal {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.93);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 99999;
      padding: 16px;
    }

    .modal-box {
      background-color: #171717;
      border-radius: 25px;
      padding: 20px 18px;
      width: 100%;
      max-width: 390px;
      text-align: center;
      box-shadow: 0 12px 34px rgba(0, 0, 0, 0.7);
      position: relative;
      transition: transform 0.4s ease-in-out;
    }

    .modal-box h3 {
      margin: 0 0 12px;
      color: #ffffff;
      font-size: 14px;
      letter-spacing: 0.03em;
      line-height: 1.4;
    }

    .auth-tabs {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 4px;
      background-color: #171717;
      border-radius: 25px;
      padding: 5px;
      margin-bottom: 14px;
      box-shadow: inset 2px 5px 10px rgb(5, 5, 5);
    }

    .auth-tab {
      background: transparent;
      border: none;
      border-radius: 20px;
      color: #d3d3d3;
      font-size: 11px;
      font-weight: 700;
      padding: 7px 4px;
      cursor: pointer;
      transition: background-color 0.4s ease-in-out, color 0.4s ease-in-out;
    }

    .auth-tab:hover { color: #ffffff; }

    .auth-tab.active {
      background-color: #252525;
      color: #ffffff;
    }

    .auth-pane {
      display: none;
      flex-direction: column;
      gap: 10px;
    }

    .auth-pane.active {
      display: flex;
    }

    .bm-pane { padding: 0 0.6em 0.4em; text-align: left; }

    .bm-heading {
      text-align: center;
      margin: 1.2em 0;
      color: #ffffff;
      font-size: 1.2em;
    }

    .bm-desc {
      margin: 0;
      color: #d3d3d3;
      font-size: 11.5px;
      line-height: 1.45;
      text-align: center;
    }

    .bm-group {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .bm-label {
      font-size: 10.5px;
      color: #d3d3d3;
      padding-left: 12px;
    }

    .bm-field {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5em;
      border-radius: 25px;
      padding: 0.6em;
      min-height: 44px;
      border: none;
      outline: none;
      color: #ffffff;
      background-color: #171717;
      box-shadow: inset 2px 5px 10px rgb(5, 5, 5);
    }

    .bm-icon {
      height: 1.3em;
      width: 1.3em;
      flex: 0 0 auto;
      fill: #ffffff;
    }

    .bm-input {
      background: none;
      border: none;
      outline: none;
      box-shadow: none;
      width: 100%;
      min-width: 0;
      min-height: 44px;
      font: inherit;
      font-size: 16px;
      color: #d3d3d3;
    }

    .bm-sr {
      position: absolute;
      width: 1px;
      height: 1px;
      margin: -1px;
      padding: 0;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    #ip-suggest-box {
      display: none;
      flex-direction: column;
      gap: 5px;
      background-color: #171717;
      border-radius: 18px;
      box-shadow: inset 2px 5px 10px rgb(5, 5, 5);
      padding: 9px 12px;
      text-align: left;
    }

    #ip-suggest-box.active {
      display: flex;
    }

    .ip-suggest-title {
      font-size: 10px;
      color: #d3d3d3;
      font-weight: 700;
    }

    .ip-suggest-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
    }

    .ip-chip {
      background-color: #252525;
      border: none;
      color: #ffffff;
      font-size: 10.5px;
      padding: 3px 9px;
      border-radius: 5px;
      cursor: pointer;
      transition: background-color 0.4s ease-in-out;
    }

    .ip-chip:hover {
      background-color: black;
      color: #ffffff;
    }

    .auth-error {
      display: none;
      color: #ff7a8a;
      background: rgba(255, 59, 92, 0.12);
      border: 1px solid #ff5c7c66;
      border-radius: 12px;
      padding: 7px 10px;
      margin-bottom: 8px;
      font-size: 11px;
      line-height: 1.4;
    }

    .auth-error.active {
      display: block;
    }

    .bm-btn-row {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      justify-content: center;
      gap: 0.4em;
      margin: 1.4em 0 0.6em;
    }

    .bm-btn {
      padding: 0.5em 1.1em;
      min-height: 44px;
      border-radius: 5px;
      border: none;
      outline: none;
      cursor: pointer;
      transition: background-color 0.4s ease-in-out, color 0.4s ease-in-out;
      background-color: #252525;
      color: #ffffff;
      font: inherit;
    }

    .bm-btn:hover { background-color: black; color: #ffffff; }
    .bm-btn-danger:hover { background-color: red; }
    .bm-btn:disabled { opacity: 0.5; cursor: wait; }

    #profile-pane {
      display: none;
      flex-direction: column;
      gap: 10px;
    }

    #profile-pane.active {
      display: flex;
    }

    .bm-profile {
      background-color: #171717;
      border-radius: 18px;
      box-shadow: inset 2px 5px 10px rgb(5, 5, 5);
      color: #d3d3d3;
      padding: 10px 14px;
      font-size: 11.5px;
      line-height: 1.6;
    }

    @media (hover: hover) {
      .modal-box:hover { transform: scale(1.05); }
    }

    /* iPhone: vùng chạm >= 44px, ô nhập 16px (chống Safari tự zoom), không tràn ngang */
    @media (pointer: coarse), (max-width: 768px) {
      .auth-tab, .bm-btn { min-height: 44px; }
      .bm-input { font-size: 16px; min-height: 44px; }
    }

    @media (max-width: 768px) {
      #modal {
        padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
        min-height: 100dvh;
        overflow-y: auto;
      }
      .modal-box { max-width: min(390px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; overflow-x: hidden; }
      .bm-pane { padding: 0 0.2em 0.2em; }
      .bm-heading { margin: 1em 0; }
      .bm-btn-row { margin: 1.2em 0 0.4em; }
    }
