/* HOUSBE Deal Room - chat message audience (client guide "HOUSBE Deal Concierge
   and Chat Implementation Guide", 2026-11-18):
     3B  Message Visibility picker (composer shield, privacy prompt, Access)
     4A/4B  the eye window: who can / cannot see, Amend checklist (author only)
     5B  "Keep the conversation in your Deal Room" (an edit the contact rule blocked)
   Markup: js/hb-msg-audience.js. One navy modal style, one quiet border. */

.hbmv {
    --mv-bg: #0a1626;
    --mv-bg2: #091423;
    --mv-border: #2c4c6e;
    --mv-row: #263e57;
    --mv-row-on-bg: #14273d;
    --mv-row-on: #4a6d94;
    --mv-text: #ffffff;
    --mv-sub: #c3ccd8;
    --mv-muted: #8fa1b7;
    --mv-gold: #efc25a;
    --mv-gold-ring: #fbc865;
    --mv-green: #1ec253;
    --mv-red: #d7333a;
    --mv-link: #8fc0e8;
    --mv-line: #2a4561;
    position: fixed; inset: 0; z-index: 2147483100;
    display: flex; align-items: center; justify-content: center;
    padding: 16px 15px;
    background: rgba(2, 6, 14, .66);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    opacity: 0; transition: opacity .16s ease;
    box-sizing: border-box;
}
.hbmv[hidden] { display: none; }
.hbmv.is-on { opacity: 1; }
.hbmv *, .hbmv *::before, .hbmv *::after { box-sizing: border-box; }

.hbmv-card {
    position: relative;
    width: 100%; max-width: 420px;
    max-height: calc(100% - 8px);
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, var(--mv-bg) 0%, var(--mv-bg2) 100%);
    border: 1.5px solid var(--mv-border);
    border-radius: 14px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, .6);
    color: var(--mv-text);
    transform: translateY(8px) scale(.985); transition: transform .18s ease;
}
.hbmv.is-on .hbmv-card { transform: none; }
.hbmv-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 24px 13px 6px; }
.hbmv-foot { padding: 19px 13px 15px; }

.hbmv-x {
    position: absolute; top: 14px; right: 14px; z-index: 1;
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    border: 0; background: transparent; color: #8aa4bf; cursor: pointer;
}
.hbmv-x svg { width: 19px; height: 19px; }
.hbmv-x:hover { color: #fff; background: rgba(255, 255, 255, .06); }
/* the eye window's X sits in a ring (4A / 4B) */
.hbmv-x.is-ring { top: 13px; right: 13px; width: 30px; height: 30px; border: 1.5px solid #2f4c6b; color: #fff; }
.hbmv-x.is-ring svg { width: 15px; height: 15px; }

.hbmv-title { margin: 0 44px 8px 6px; font-size: 22px; line-height: 1.2; font-weight: 800; letter-spacing: -.005em; color: #fff; }
.hbmv-sub { margin: 0 0 12px 6px; font-size: 15.5px; line-height: 1.4; color: var(--mv-sub); }

/* ── 3B: the three choices ─────────────────────────────────────────────── */
.hbmv-opts { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; border: 0; }
.hbmv-opts legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hbmv-opt {
    position: relative;
    display: flex; align-items: center;
    min-height: 64px; padding: 8px 10px 8px 0;
    border: 1px solid var(--mv-row); border-radius: 10px;
    background: transparent; cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.hbmv-opt:hover { border-color: #375675; }
.hbmv-opt.is-on { background: var(--mv-row-on-bg); border-color: var(--mv-row-on); }
.hbmv-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.hbmv-opt:has(input:focus-visible) { outline: 2px solid #9cc7f0; outline-offset: 2px; }
.hbmv-ic { flex: 0 0 56px; display: grid; place-items: center; color: #f2f4f7; }
.hbmv-ic svg { width: 26px; height: 26px; }
.hbmv-opt[data-v="public"] .hbmv-ic svg { width: 30px; height: 30px; }
.hbmv-div { flex: 0 0 1px; align-self: center; height: 30px; background: #6e7a87; margin-right: 12px; }
.hbmv-txt { flex: 1 1 auto; min-width: 0; }
.hbmv-txt b { display: block; font-size: 17px; line-height: 1.25; font-weight: 700; color: #fff; }
.hbmv-txt span { display: block; margin-top: 2px; font-size: 13.6px; line-height: 1.3; color: var(--mv-sub); }
.hbmv-radio {
    flex: 0 0 20px; width: 20px; height: 20px; margin-left: 2px; border-radius: 50%;
    border: 1.5px solid #c2c2c6; display: grid; place-items: center;
}
.hbmv-opt.is-on .hbmv-radio { border: 2px solid var(--mv-gold-ring); }
.hbmv-opt.is-on .hbmv-radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--mv-gold); }

/* the checklist under Select Participants / Select by Role */
.hbmv-panel { margin: -2px 0 2px; padding: 10px 12px 8px; border: 1px solid var(--mv-row); border-radius: 10px; background: rgba(255, 255, 255, .02); }
.hbmv-panel[hidden] { display: none; }
.hbmv-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.hbmv-link { border: 0; background: none; padding: 6px 0; min-height: 32px; color: var(--mv-link); font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.2; cursor: pointer; }
.hbmv-link:hover { text-decoration: underline; }
.hbmv-pipe { color: #6d8db0; font-weight: 600; }
.hbmv-count { margin-left: auto; font-size: 13.5px; font-weight: 600; color: var(--mv-muted); }
.hbmv-list { max-height: 216px; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.hbmv-check {
    display: flex; align-items: center; gap: 12px;
    min-height: 46px; padding: 6px 2px;
    border-bottom: 1px solid var(--mv-line); cursor: pointer;
}
.hbmv-list li:last-child .hbmv-check { border-bottom: 0; }
.hbmv-check input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.hbmv-av {
    flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center;
    background: #262c37; color: #ebd8a8;
    font-size: 13px; font-weight: 700; letter-spacing: .02em;
}
.hbmv-name { flex: 1 1 auto; min-width: 0; font-size: 16px; line-height: 1.25; color: #fff; overflow-wrap: anywhere; }
.hbmv-name small { display: block; font-size: 13px; color: var(--mv-muted); }
.hbmv-box {
    flex: 0 0 20px; width: 20px; height: 20px; border-radius: 4px;
    border: 1.5px solid #8ea3ba; display: grid; place-items: center; color: #fff;
}
.hbmv-box svg { width: 14px; height: 14px; opacity: 0; }
.hbmv-check input:checked + .hbmv-box { background: var(--mv-green); border-color: var(--mv-green); }
.hbmv-check input:checked + .hbmv-box svg { opacity: 1; }
.hbmv-check input:focus-visible + .hbmv-box { outline: 2px solid #9cc7f0; outline-offset: 2px; }
.hbmv-check.is-locked { cursor: default; }
.hbmv-lock { flex: 0 0 18px; color: #e9edf2; display: grid; place-items: center; }
.hbmv-lock svg { width: 17px; height: 17px; }
.hbmv-empty { padding: 8px 0; font-size: 14.5px; color: var(--mv-muted); }

.hbmv-note { margin: 10px 4px 0; font-size: 14px; line-height: 1.4; color: var(--mv-muted); }
.hbmv-note:empty { display: none; }
.hbmv-note.is-err { color: #ff9b9b; }
.hbmv-note.is-ok { color: #7ee2a2; }

/* the buttons: Cancel (outline) + Save (gold) / Save changes (red) */
.hbmv-btns { display: flex; gap: 8px; }
.hbmv-btn {
    flex: 1 1 0; min-height: 42px; padding: 0 12px; border-radius: 9px;
    font-family: inherit; font-size: 17px; font-weight: 700; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.hbmv-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.hbmv-btn[disabled] { opacity: .65; cursor: default; }
.hbmv-cancel { background: #0e1e32; border: 1.5px solid #6d8bad; color: #fff; }
.hbmv-cancel:hover { background: #13263e; }
.hbmv-save { background: var(--mv-gold); border: 1.5px solid var(--mv-gold); color: #10141c; }
.hbmv-save:hover { background: #f4ca68; }
.hbmv-red { background: var(--mv-red); border: 1.5px solid var(--mv-red); color: #fff; }
.hbmv-red:hover { background: #e03c43; }
.hbmv-close-only { display: flex; justify-content: flex-end; }
.hbmv-close-only .hbmv-btn { flex: 0 0 auto; min-width: 104px; border-radius: 999px; background: #0d1d33; border-color: #2f4c6b; font-weight: 600; }

/* the privacy prompt on phones, where the composer has room only for the shield */
.hbmv-prompt { display: none; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 2px 4px 0; font-size: 14px; color: var(--mv-sub); }
.hbmv-prompt .hbmv-sw { position: relative; flex: 0 0 auto; width: 44px; height: 26px; border-radius: 999px; border: 1.5px solid #557495; background: #0e1e32; cursor: pointer; }
.hbmv-prompt .hbmv-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #9fb3c8; transition: transform .15s ease, background-color .15s ease; }
.hbmv-prompt .hbmv-sw[aria-checked="true"] { background: #13492b; border-color: #3ee98c; }
.hbmv-prompt .hbmv-sw[aria-checked="true"]::after { transform: translateX(18px); background: #3ee98c; }
@media (max-width: 600px) { .hbmv-prompt.is-avail { display: flex; } }

/* ── 4A / 4B: the eye window ──────────────────────────────────────────── */
.hbmv-eye .hbmv-card { background: linear-gradient(180deg, #0a1a2f 0%, #071629 100%); border-color: #284b6e; }
.hbmv-eye .hbmv-title { margin-bottom: 16px; }
.hbmv-phead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 4px 6px; }
.hbmv-phead h3 { margin: 0; font-size: 19px; font-weight: 800; color: #fff; }
.hbmv-amend {
    flex: 0 0 auto; min-height: 26px; padding: 0 13px; border-radius: 999px;
    border: 0; background: var(--mv-green); color: #fff;
    font-family: inherit; font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer;
}
.hbmv-amend:hover { background: #22d05c; }
.hbmv-amend[aria-pressed="true"] { cursor: default; }
.hbmv-amend:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.hbmv-sec { margin: 14px 0 4px 6px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.hbmv-sec svg { width: 17px; height: 17px; flex: 0 0 auto; }
.hbmv-sec.is-can { color: #3ee98c; }
.hbmv-sec.is-can svg { color: #e7edf4; }
.hbmv-sec.is-cannot { color: #8a94a6; }
.hbmv-people { margin: 0 0 0 6px; padding: 0; list-style: none; }
.hbmv-people li { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 16px; color: #e8edf3; }
.hbmv-people li .hbmv-av { width: 30px; height: 30px; flex-basis: 30px; font-size: 12.5px; }
.hbmv-hr { height: 1px; margin: 10px 4px 0; background: rgba(255, 255, 255, .08); }
.hbmv-none { margin: 6px 0 0 6px; font-size: 15px; color: #a9b4c3; }
.hbmv-amendlist { margin: 0 0 0 4px; }
.hbmv-amendlist .hbmv-list { outline: none; }
.hbmv-amendlist .hbmv-check { min-height: 46px; padding-right: 0; }
.hbmv-amendlist .hbmv-list li:last-child .hbmv-check { border-bottom: 1px solid var(--mv-line); }
.hbmv-amendlist .hbmv-lock { margin-left: 2px; }
.hbmv-eye .hbmv-foot { padding-top: 26px; }
.hbmv-eye .hbmv-btns { gap: 14px; }
.hbmv-eye .hbmv-btn { min-height: 40px; }
.hbmv-eye .hbmv-cancel { background: transparent; border-color: #8fb8e0; }
.hbmv-card:focus { outline: none; }
.hbmv-amendlist .hbmv-tools { margin: -8px 0 2px 2px; }
.hbmv-loading { padding: 18px 6px; color: var(--mv-muted); font-size: 15px; }

/* ── 5B: an edit the contact rule blocked ─────────────────────────────── */
.hbmv-warn { padding-left: 26px; padding-right: 26px; }
.hbmv-warn .hbmv-card { max-width: 380px; background: #0b1324; border: 1px solid #516686; border-radius: 13px; }
.hbmv-warn .hbmv-scroll { padding: 34px 12px 4px 18px; }
.hbmv-warn .hbmv-foot { padding: 10px 13px 12px; }
.hbmv-warn .hbmv-x { top: 6px; right: 6px; color: #6f86a8; }
.hbmv-whead { display: flex; align-items: center; gap: 14px; margin: 0 6px 9px 2px; }
.hbmv-whead svg { flex: 0 0 23px; width: 23px; height: 23px; color: #f6c35a; }
.hbmv-whead h2 { margin: 0; font-size: 19.5px; line-height: 1.2; font-weight: 800; color: #fff; }
.hbmv-wbody { margin: 0; font-size: 15px; line-height: 1.45; color: #d9e0ea; }
.hbmv-back { width: 100%; min-height: 38px; border-radius: 9px; border: 0; background: #f0c256; color: #11141c; font-family: inherit; font-size: 17.5px; font-weight: 800; line-height: 1; cursor: pointer; }
.hbmv-back:hover { background: #f5cb66; }
.hbmv-back:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

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

@media (max-width: 380px) {
    .hbmv { padding-left: 12px; padding-right: 12px; }
    .hbmv-txt b { font-size: 16px; }
    .hbmv-txt span { font-size: 13.2px; }
}
@media (prefers-reduced-motion: reduce) {
    .hbmv, .hbmv-card, .hbmv-opt { transition: none; }
}
