/* ====================================================================
   SCREEN 50 — MESSAGES, the counter's and the desk's side (slice M50b,
   2026-10-10): the Message door on 09's cards, 09b and 21's visit card
   (.vm-mh-door), and the host the thread opens in — the phone's sheet
   (50d-2) and, from 901px, the 440 panel docked right (50-d-counter).
   js/<hub>/thread-host.js writes the markup; the thread inside is
   js/<hub>/thread.js with its own styles (50-messages.css, linked before
   this file).
   Contract: docs/design/pharmacy/briefs/2026-10-10_screen-50-contract.md;
   sheet: docs/design/pharmacy/screens/50/FACTS.md (50d, 50d-2,
   50-d-counter).

   BYTE-IDENTICAL in css/pharmacy/50-thread-host.css and
   css/exams/50-thread-host.css (thread.js's precedent): each half links
   only its own copy, after 50-messages.css and before desktop/shared.css.
   Not under desktop/: the host runs at every width; its panel rules sit
   in the min-width block at the foot. What each page does beside the
   panel (the board narrowing, the ring on the opened card) is the page's
   own desktop file (css/pharmacy/desktop/50-counter.css,
   css/exams/desktop/50-desk.css).

   Literal values only; Inter; teal #0f6d5c, mint #e3f4f0; never a blue,
   a yellow or an orange. Every target 44.
   ==================================================================== */


/* ====================================================================
   1. THE DOOR (50d): the card's last row, under its acts — a hairline
   above it, tile 34, "Message Marie Ngo" over "About VM-4821" or, unread,
   "1 new message" (teal 700, the chevron teal). No dot, no badge (C3).
   ==================================================================== */

.vm-mh-door {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 56px;
    margin: 0;
    padding: 8px 14px;
    box-sizing: border-box;
    border: 0;
    border-top: 1px solid #f0f2f4;
    border-radius: 0;
    background: transparent;
    color: #0f172a;
    font-family: 'Inter', -apple-system, sans-serif;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.vm-mh-door:focus-visible { outline: 2px solid #0f6d5c; outline-offset: -2px; }
/* 09b: no card holds it, so it is its own bordered row (06's idiom). */
.vm-mh-door--alone {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
}
.vm-mh-door--alone:focus-visible { outline-offset: 2px; }
.vm-mh-tile {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: #e3f4f0;
    color: #0f6d5c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.vm-mh-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.vm-mh-t {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
    overflow-wrap: anywhere;
}
.vm-mh-s {
    font-size: 11.5px;
    line-height: 1.35;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}
.vm-mh-s[hidden] { display: none; }
.vm-mh-sep { color: #cbd5e1; }
.vm-mh-door.is-new .vm-mh-s { font-weight: 700; color: #0f6d5c; }
.vm-mh-chev { flex-shrink: 0; font-size: 13px; color: #64748b; }
.vm-mh-door.is-new .vm-mh-chev { color: #0f6d5c; }
@media (hover: hover) {
    .vm-mh-door:hover { background: #f8fafc; color: #0f172a; }
}


/* ====================================================================
   2. THE HOST, PHONE (50d-2): the scrim, the sheet from 64 to the foot
   (#f8fafc, radius 22 22 0 0); the thread fills it (its head carries the
   grip, the name, the case line and Close). The page under it does not
   scroll while it is up.
   ==================================================================== */

html.vm-mh-lock,
html.vm-mh-lock body { overflow: hidden; }

.vm-mh-dim {
    position: fixed;
    inset: 0;
    z-index: 64;
    background: rgba(15, 23, 42, .5);
}
.vm-mh-dim[hidden] { display: none; }

.vm-mh-shell {
    position: fixed;
    left: 0;
    right: 0;
    top: 64px;
    bottom: 0;
    z-index: 65;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 30px rgba(2, 26, 21, .18);
    overflow: hidden;
}
.vm-mh-shell[hidden] { display: none; }
.vm-mh-host {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.vm-mh-host > .vm-th {
    flex: 1 1 auto;
    min-height: 0;
}


/* ====================================================================
   3. FROM 901 (50-d-counter): the 440 panel docked right, from under the
   header (64) to the window's foot, no dim; the page beside it stays in
   use. Its head and composer are the thread's panel layout.
   ==================================================================== */

@media (min-width: 901px) {
    .vm-mh-dim { display: none; }
    .vm-mh-shell {
        left: auto;
        right: 0;
        top: 64px;
        bottom: 0;
        width: 440px;
        z-index: 45;
        border-radius: 0;
        border-left: 1px solid #e2e8f0;
        box-shadow: -12px 0 28px rgba(16, 24, 40, .08);
    }
}
