/* ===================================================================
   RENTALS HUB — INBOX
   Pixel truth: rental-design-zip/rental-hub/Inbox.dc.html.
   Tokens + base + bottom nav come from app.css.
   =================================================================== */

.vm-inbox {
    background: #fff;
    padding-bottom: 96px;
}

/* ---- Header ---- */
.vm-inbox-head { padding: 18px 20px 12px; }
.vm-inbox-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.vm-inbox-head-row h1 {
    margin: 0;
    font-family: var(--vm-font-display);
    font-weight: 700;
    font-size: 24px;
    color: var(--vm-text);
}
.vm-inbox-pen {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--vm-tint);
    color: var(--vm-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.vm-inbox-search {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f3f5;
    border-radius: 12px;
    padding: 0 14px;
}
.vm-inbox-search i { color: var(--vm-muted-2); font-size: 14px; }
.vm-inbox-search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    color: var(--vm-text);
    padding: 11px 0;
    min-width: 0;
}

/* ---- Filter tabs ---- */
.vm-inbox-tabs {
    display: flex;
    gap: 8px;
    padding: 0 20px 10px;
    overflow-x: auto;
}
.vm-inbox-tab {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 999px;
    background: #f1f3f5;
    color: var(--vm-text-2);
    white-space: nowrap;
}
.vm-inbox-tab.is-active {
    font-weight: 600;
    background: var(--vm-primary);
    color: #fff;
}

/* ---- Conversation rows ---- */
.vm-conv-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    cursor: pointer;
    color: inherit;
}
.vm-conv-row:hover { color: inherit; background: #fafbfc; }

.vm-conv-avatar-wrap { position: relative; flex-shrink: 0; }
.vm-conv-avatar {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}
.vm-conv-avatar-fallback {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    line-height: 1;
}

.vm-conv-main { flex: 1; min-width: 0; }
.vm-conv-top {
    display: flex;
    align-items: center;
    gap: 5px;
}
.vm-conv-name {
    font-weight: 600;
    font-size: 14.5px;
    color: var(--vm-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vm-conv-row.is-unread .vm-conv-name { font-weight: 700; }
.vm-conv-chip-yours {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--vm-primary-dark);
    background: var(--vm-tint);
    border-radius: 999px;
    padding: 2px 7px;
    white-space: nowrap;
    flex-shrink: 0;
}
.vm-conv-time {
    margin-left: auto;
    font-size: 11px;
    color: var(--vm-muted-2);
    white-space: nowrap;
    flex-shrink: 0;
}
.vm-conv-row.is-unread .vm-conv-time {
    color: var(--vm-primary);
    font-weight: 600;
}
.vm-conv-listing {
    font-size: 12px;
    color: var(--vm-muted-2);
    margin: 1px 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vm-conv-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vm-conv-preview {
    flex: 1;
    font-size: 13px;
    color: var(--vm-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vm-conv-row.is-unread .vm-conv-preview {
    color: var(--vm-text-2);
    font-weight: 600;
}
.vm-conv-badge {
    flex-shrink: 0;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--vm-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Loading / empty states ---- */
.vm-inbox-loading {
    text-align: center;
    padding: 40px 20px;
    font-size: 13px;
    color: var(--vm-muted-2);
}
.vm-inbox-empty {
    text-align: center;
    padding: 46px 30px;
}
.vm-inbox-empty i {
    font-size: 30px;
    color: var(--vm-muted-2);
    margin-bottom: 12px;
    display: block;
}
.vm-inbox-empty p {
    margin: 0 0 14px;
    font-size: 13.5px;
    color: var(--vm-muted);
}
.vm-inbox-empty a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--vm-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 999px;
}
.vm-inbox-empty a:hover { color: #fff; }


/* ===================================================================
   DESKTOP LAYER — >= 901px
   ===================================================================
   Appended at the END of this file: the load order is app.css ->
   inbox.css -> desktop.css, so these rules sit after every mobile base
   rule they override (the repo's cascade-order trap) and ahead of
   desktop.css, whose only overlap here is the shared
   .vm-app.vm-dt-shell frame reset and the body background — both
   out-specified below by carrying the extra .vm-inbox class.

   The desktop design merges the inbox and the thread into one
   three-pane screen. We keep TWO pages (inbox.html and chat.html both
   have live URLs the rest of the hub navigates to), so this is the
   design's LIST PANE, promoted to a centred card. Rows are untouched
   markup: same fields, same href, same handler.

   NOT BUILT from the design: the row presence dot ("online"), and the
   Messages icon's green unread dot in the site header — neither has a
   backend signal (see the header comment in js/rentals/inbox.js).
   =================================================================== */
@media (min-width: 901px) {

body:has(.vm-app.vm-inbox.vm-dt-shell) { background: var(--vm-dt-canvas-alt); }

.vm-app.vm-inbox.vm-dt-shell {
    max-width: none;
    box-shadow: none;
    background: var(--vm-dt-canvas-alt);
    padding: 28px var(--vm-dt-pad) 56px;
    /* desktop.css sets calc(100vh - 72px), which forgets the header's 1px
       bottom border and leaves the page 1px scrollable with nothing to
       scroll to. Measured, not guessed. */
    min-height: calc(100vh - var(--vm-dt-header-h) - 1px);

    /* Single centred column. Every child is placed explicitly so the
       ::before card backdrop can overlap rows 2..5 without disturbing
       auto-placement — no wrapper div, so the phone's DOM is unchanged
       (the technique desktop.css §8.5 uses). */
    display: grid;
    grid-template-columns: min(760px, 100%);
    grid-template-rows: auto auto auto auto auto;
    justify-content: center;
    /* .vm-app carries a min-height, and `align-content: normal` would let
       the five auto rows grow equally to fill it — the card would stretch to
       the viewport with the rows floating apart. Pin them to the top. */
    align-content: start;
}

/* .vm-inbox-head groups the H1 row and the search field for the phone.
   On desktop the H1 is a page heading OUTSIDE the card and the search is
   the card's first band, so the group dissolves into the grid. */
.vm-inbox.vm-dt-shell .vm-inbox-head { display: contents; }

/* The card: one backdrop rather than borders on four separate bands, so
   the corners stay clean. A grid container's ::before IS a grid item; the
   1px "border" is a spread shadow, painted outside the box, so it can
   never overlap the children stacked on it. */
.vm-inbox.vm-dt-shell::before {
    content: "";
    grid-column: 1;
    grid-row: 2 / -1;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 0 0 1px var(--vm-border-2), var(--vm-dt-shadow-card);
    z-index: 0;
}
.vm-inbox.vm-dt-shell > *,
.vm-inbox.vm-dt-shell .vm-inbox-head > * { position: relative; z-index: 1; }

.vm-inbox.vm-dt-shell .vm-inbox-head-row { grid-column: 1; grid-row: 1; margin-bottom: 18px; }
.vm-inbox.vm-dt-shell .vm-inbox-search { grid-column: 1; grid-row: 2; }
.vm-inbox.vm-dt-shell .vm-inbox-tabs { grid-column: 1; grid-row: 3; }
.vm-inbox.vm-dt-shell .vm-inbox-list { grid-column: 1; grid-row: 4; }
.vm-inbox.vm-dt-shell .vm-inbox-empty { grid-column: 1; grid-row: 5; }

/* --- Page heading ------------------------------------------------- */
.vm-dt-shell .vm-inbox-head-row h1 {
    font-size: clamp(22px, 2.4vw, 30px);
    letter-spacing: -.8px;
    line-height: 1.14;
}
/* The "New message" pen has no handler and no destination: a rental
   conversation is only ever created FROM a listing (chat.html?listing=...),
   so there is nothing for a compose button to open. It shipped inert on the
   phone; the desktop layer first gave it a border and a hover state, which
   made a dead control look more clickable than it does on a phone. Hidden
   here instead. Removing it from the markup would change <= 900px, which is
   frozen, so it stays in the DOM and is gated by width like everything else
   on this page. When a real compose flow exists, delete this rule and wire
   the button. */
.vm-dt-shell .vm-inbox-pen { display: none; }

/* --- Card head: search + tabs ------------------------------------- */
.vm-dt-shell .vm-inbox-search { margin: 16px 16px 12px; }
.vm-dt-shell .vm-inbox-search input { font-size: 13.5px; padding: 10px 0; }
.vm-dt-shell .vm-inbox-tabs {
    gap: 7px;
    padding: 0 16px 13px;
    border-bottom: 1px solid #f0f2f4;
}
.vm-dt-shell .vm-inbox-tab { font-size: 12.5px; padding: 7px 14px; }
.vm-dt-shell .vm-inbox-tab:not(.is-active):hover { background: #e7eaec; }

/* --- Rows --------------------------------------------------------- */
/* Rows stay exactly as they ship: unread is bold name + preview, a green
   timestamp and the count badge. The design's green wash + 3px left rule
   marks the CURRENTLY OPEN thread in its merged three-pane screen — there is
   no open thread on this page, so borrowing that treatment for "unread"
   would read as a selection that is not one. Hairline dividers instead, so
   a long list is still scannable at desktop row heights. */
.vm-dt-shell .vm-inbox-list { padding-bottom: 8px; }
.vm-dt-shell .vm-conv-row { padding: 13px 18px; }
.vm-dt-shell .vm-conv-row + .vm-conv-row { border-top: 1px solid #f4f6f7; }
.vm-dt-shell .vm-conv-row:hover { background: #f7f9f8; }
.vm-dt-shell .vm-conv-avatar,
.vm-dt-shell .vm-conv-avatar-fallback { width: 48px; height: 48px; font-size: 19px; }
.vm-dt-shell .vm-conv-name { font-size: 14px; }
.vm-dt-shell .vm-conv-listing { font-size: 11.5px; }
.vm-dt-shell .vm-conv-preview { font-size: 12.5px; }
.vm-dt-shell .vm-conv-time { font-size: 10.5px; }
.vm-dt-shell .vm-conv-chip-yours { font-size: 9px; }
.vm-dt-shell .vm-conv-badge { min-width: 18px; height: 18px; font-size: 10.5px; }

/* --- Empty state -------------------------------------------------- */
.vm-dt-shell .vm-inbox-empty { padding: 52px 24px 56px; }
.vm-dt-shell .vm-inbox-empty i { font-size: 34px; }
.vm-dt-shell .vm-inbox-empty p { font-size: 14px; }

} /* end >= 901px */
