/* Booking origin is separate from the channel chosen in the composer. */
body.rm-admin .guesty-chat-card .guesty-chat-status { display:flex; align-items:center; gap:6px; min-height:24px; overflow:visible; white-space:normal; flex-wrap:wrap; }
body.rm-admin .guesty-chat-card .chat-origin { display:inline-flex; align-items:center; justify-content:center; height:24px; padding:0 8px; border-radius:6px; font:700 11px/1 system-ui,-apple-system,"Segoe UI",sans-serif; letter-spacing:-.15px; white-space:nowrap; background:#f0f2f5; color:#536176; }
body.rm-admin .chat-origin[data-origin="expedia"] { background:#ffef80; color:#191e3b; font-weight:800; }
body.rm-admin .chat-origin[data-origin="airbnb"] { background:#fff0f2; color:#e33d59; }
body.rm-admin .chat-origin[data-origin="booking"] { background:#003b95; color:#fff; letter-spacing:-.3px; }
body.rm-admin .chat-origin[data-origin="vrbo"] { background:#eaf2ff; color:#195fc3; }
body.rm-admin .chat-origin[data-origin="decolar"] { background:#f3eaff; color:#6633b9; }
body.rm-admin .chat-origin[data-origin="hotels"] { background:#fff0f0; color:#c22431; }
body.rm-admin .chat-origin[data-origin="direct"] { background:#f7f1df; color:#786126; }
body.rm-admin .chat-origin[data-origin="whatsapp"] { background:#eaf7ef; color:#25814b; }
body.rm-admin .guesty-chat-card .chat-reservation-count { display:inline-flex; align-items:center; justify-content:center; min-width:24px; height:24px; padding:0 4px; border:1px solid #dce2eb; border-radius:6px; background:#f5f7fa; color:#213653; font-family:inherit; font-size:11px; font-weight:700; line-height:1; cursor:pointer; flex:none; box-shadow:none; }
body.rm-admin .chat-reservation-count:focus-visible { outline:2px solid #5488c7; outline-offset:2px; }
body.rm-admin .chat-identity-whatsapp { color:#2b9d58; font-size:15px; flex:none; }
body.rm-admin .chat-identity-notice { flex-basis:100%; font-size:11px; }
body.rm-admin .guesty-chat-status [hidden] { display:none!important; }

/* Keep the identity together; a hidden mobile back button must not reserve a grid track. */
body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head { display:grid; grid-template-columns:40px minmax(0,1fr) auto; align-items:center; column-gap:8px; row-gap:0; padding:8px 10px; }
body.rm-admin .guesty-chat-card .guesty-chat-head-copy { grid-column:2; grid-row:1; display:flex; flex-direction:column; align-items:stretch; gap:2px; min-width:0; }
body.rm-admin .guesty-chat-card .guesty-chat-avatar { grid-column:1; grid-row:1; align-self:center; width:40px; height:40px; min-width:40px; margin:0; }
body.rm-admin .guesty-chat-card .guesty-chat-title-row { min-width:0; margin:0; }
body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head h2 { font-size:16px; line-height:20px; margin:0; }
body.rm-admin .guesty-chat-card .guesty-chat-status { display:flex; align-items:center; flex-wrap:wrap; gap:3px; min-height:18px; margin:0; padding:0; }
body.rm-admin .guesty-chat-card .chat-origin { height:18px; padding:0 5px; font-size:10px; border-radius:5px; }
body.rm-admin .guesty-chat-card .chat-reservation-count { min-width:18px; height:18px; padding:0 3px; font-size:10px; border-radius:5px; }
body.rm-admin .guesty-chat-card .chat-identity-whatsapp { font-size:15px; line-height:18px; }
body.rm-admin .guesty-chat-card .guesty-chat-head-actions { grid-column:3; grid-row:1; align-self:center; gap:4px; }
body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head .guesty-chat-head-actions > .icon-button,
body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head .guesty-chat-head-actions > .guesty-chat-face-status,
body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head .guesty-chat-head-actions > .guesty-chat-clean-status { flex:0 0 40px; width:40px; min-width:40px; height:40px; margin:0; }
body.rm-admin .guesty-chat-head > .guesty-chat-stay,
body.rm-admin .guesty-chat-head > .chat-checkout-summary,
body.rm-admin .guesty-chat-head > .guesty-chat-line,
body.rm-admin .guesty-chat-head > .wl-chat,
body.rm-admin .guesty-chat-head > #chat-concurrent-stays { grid-column:1 / -1; }
@media(min-width:781px) {
 body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head { grid-template-columns:40px 40px minmax(0,1fr) auto; }
 body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head .guesty-chat-collapse { grid-column:1; grid-row:1; width:40px; min-width:40px; height:40px; }
 body.rm-admin .guesty-chat-card .guesty-chat-avatar { grid-column:2; }
 body.rm-admin .guesty-chat-card .guesty-chat-head-copy { grid-column:3; }
 body.rm-admin .guesty-chat-card .guesty-chat-head-actions { grid-column:4; }
}

/* Conversation media remains available from the composer + menu. */
body.rm-admin .guesty-chat-card #guesty-chat-media-gallery { display:none!important; }

body.rm-admin .guesty-chat-card .chat-cancel-send { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; min-width:28px; min-height:28px; padding:2px; margin:-5px -3px -5px 0; border:0; border-radius:50%; background:transparent; color:inherit; box-shadow:none; cursor:pointer; font:inherit; }
body.rm-admin .chat-cancel-send:hover { background:#ffffff20; }
body.rm-admin .chat-cancel-send:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
body.rm-admin .chat-cancel-send:disabled { cursor:wait; opacity:.6; }

/* Separate guest identity from the facts strip; Portaria state now surrounds the existing avatar image. */
body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head { row-gap:10px; padding:12px 12px 10px; }
/* CHAT-header-trim: the Portaria icon (#guesty-chat-face-status) is shown again (the only way to the Portaria modal). */
body.rm-admin .guesty-chat-card button#guesty-chat-avatar[data-checkin-state] { box-shadow:0 0 0 2px #fff,0 0 0 4px var(--chat-checkin-color); }
body.rm-admin #guesty-chat-avatar[data-checkin-state="entered"] { --chat-checkin-color:#2b7c59; }
body.rm-admin #guesty-chat-avatar[data-checkin-state="registered"] { --chat-checkin-color:#6d4aff; }
body.rm-admin #guesty-chat-avatar[data-checkin-state="missing"] { --chat-checkin-color:#6b7280; }

/* CHAT-header-trim (26 Oct 2026, -ht2, owner). Chat header right side: Portaria icon (when the chat has a stay) + archive (when the
   channel allows it; its only entry point) + close. The cleaning badge (the green "sparkle") and the WhatsApp glyph after the
   origin/count chips stay in the DOM (scripts unchanged) but are not displayed. The avatar opens the reservation history and keeps
   the Portaria ring (entered green / registered purple / missing grey) with a static soft glow in the same colour behind it:
   box-shadow only, the image is untouched, no animation (nothing for prefers-reduced-motion to stop). */
body.rm-admin .guesty-chat-card #guesty-chat-clean-status,
body.rm-admin .guesty-chat-card .guesty-chat-status .chat-identity-whatsapp { display:none!important; }
body.rm-admin .guesty-chat-card button#guesty-chat-avatar[data-checkin-state],
body.rm-admin .guest-history-avatar[data-checkin-state] { box-shadow:0 0 0 2px #fff,0 0 0 4px var(--chat-checkin-color),0 0 10px 5px var(--chat-checkin-glow,transparent); }
body.rm-admin #guesty-chat-avatar[data-checkin-state="entered"],
body.rm-admin .guest-history-avatar[data-checkin-state="entered"] { --chat-checkin-color:#2b7c59; --chat-checkin-glow:rgba(43,124,89,.34); }
body.rm-admin #guesty-chat-avatar[data-checkin-state="registered"],
body.rm-admin .guest-history-avatar[data-checkin-state="registered"] { --chat-checkin-color:#6d4aff; --chat-checkin-glow:rgba(109,74,255,.30); }
body.rm-admin #guesty-chat-avatar[data-checkin-state="missing"],
body.rm-admin .guest-history-avatar[data-checkin-state="missing"] { --chat-checkin-color:#6b7280; --chat-checkin-glow:rgba(107,114,128,.24); }

/* Composer "+" menu: a sheet that emerges from the channel-chip row instead of floating above it. Its rounded bottom edge sits
   just under the top of the chips' border (composer padding 8 + chip row padding 5 + 4 px), the chip row is drawn over it, and it
   grows upward over the conversation as far as its items need, across the chat column (mobile and desktop), scrolling when taller
   than the room. Same items, order, actions, colours and corners; the opening fade is the existing one. */
body.rm-admin #guesty-chat-form .guesty-chat-route { position:relative; z-index:7; }
body.rm-admin #guesty-chat-form #guesty-chat-quick-menu { --qm-dock:17px; left:8px; right:8px; bottom:calc(100% - var(--qm-dock)); width:auto; max-height:max(220px, calc(100dvh - 250px)); overflow-y:auto; padding-bottom:calc(6px + var(--qm-dock)); border-radius:16px; }
@media (pointer:fine) and (min-width:781px) {
 body.rm-admin #guesty-chat-form #guesty-chat-quick-menu { left:12px; right:12px; }
}

/* Guest history: a clean sheet in the Madalena theme (8-12 px radii). Mobile: full height; desktop: a modal. */
body.rm-admin #guest-history-modal .guest-history-card { width:min(640px,100%); max-height:min(88dvh,780px); border-radius:12px; background:#fff; }
body.rm-admin #guest-history-modal .guest-history-head { display:grid; grid-template-columns:48px minmax(0,1fr) auto; align-items:center; gap:14px; padding:16px 18px; border-bottom:1px solid var(--rm-line); background:#fff; }
body.rm-admin .guest-history-avatar { display:grid; place-items:center; width:48px; height:48px; border-radius:50%; background:linear-gradient(140deg,#d8b86e,#b38b3c); color:#fff; font-size:16px; font-weight:700; }
body.rm-admin .guest-history-avatar.has-image { background:#f1ead9; }
body.rm-admin .guest-history-avatar img { display:block; width:100%; height:100%; border-radius:50%; object-fit:cover; }
body.rm-admin .guest-history-heading { display:grid; gap:2px; min-width:0; }
body.rm-admin .guest-history-eyebrow { color:#8a6a24; font-size:10.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
body.rm-admin #guest-history-modal #guest-history-title { margin:0; overflow:hidden; color:var(--rm-primary); font-size:18px; line-height:23px; text-overflow:ellipsis; white-space:nowrap; }
body.rm-admin #guest-history-modal .guest-history-head small { margin:0; color:var(--rm-text); font-size:12.5px; font-weight:600; }
body.rm-admin #guest-history-modal .guest-history-body { padding:14px 18px 18px; background:#f6f8fb; }
body.rm-admin #guest-history-modal .guest-history-summary { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:0 0 10px; } /* HISTORY-fix: 3 cards */
body.rm-admin #guest-history-modal .guest-history-summary > div { padding:10px 12px; border-radius:8px; background:#fff; }
body.rm-admin #guest-history-modal .guest-history-summary dt { font-size:10.5px; letter-spacing:.02em; }
body.rm-admin #guest-history-modal .guest-history-summary dd { margin-top:3px; font-size:14px; }
body.rm-admin #guest-history-modal #guest-history-note { margin:0 0 12px; font-size:11.5px; }
body.rm-admin #guest-history-modal .guest-history-list { display:grid; gap:8px; }
body.rm-admin #guest-history-modal .guest-history-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:12px; padding:12px 14px; border:1px solid var(--rm-line); border-radius:8px; background:#fff; } /* HISTORY-fix: no accent bar */
/* HISTORY-fix (owner): status only through the chip; the current stay gets a faint tint at most. */
body.rm-admin #guest-history-modal .guest-history-row.is-current { border-color:#d3e8dc; background:#f7fbf9; }
body.rm-admin #guest-history-modal .guest-history-row.is-cancelled .ghr-main { opacity:.72; }
body.rm-admin #guest-history-modal .guest-history-row > .ghr-main { display:grid; gap:4px; min-width:0; }
body.rm-admin #guest-history-modal .guest-history-row > .ghr-side { display:flex; flex-direction:row; flex-wrap:nowrap; align-items:center; justify-content:flex-end; gap:8px; } /* HISTORY-fix: one row */
body.rm-admin #guest-history-modal .guest-history-row > .ghr-side > * { flex:0 0 auto; }
body.rm-admin #guest-history-modal .ghr-unit { color:var(--rm-primary); font-size:15px; line-height:19px; }
body.rm-admin #guest-history-modal .ghr-dates { color:#33475f; font-size:13px; }
body.rm-admin #guest-history-modal .ghr-meta { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; color:var(--rm-text); font-size:12px; }
body.rm-admin #guest-history-modal .ghr-meta .chat-origin { display:inline-flex; align-items:center; height:20px; padding:0 6px; border-radius:5px; font-size:10.5px; font-weight:700; white-space:nowrap; }
body.rm-admin .chat-origin[data-origin="other"] { background:#f0f2f5; color:#536176; }
body.rm-admin #guest-history-modal .ghr-code { font-variant-numeric:tabular-nums; letter-spacing:.02em; }
body.rm-admin #guest-history-modal .ghr-status { display:inline-flex; align-items:center; height:22px; padding:0 8px; border-radius:5px; background:#eef2f7; color:#33475f; font-size:11px; font-weight:700; white-space:nowrap; }
body.rm-admin #guest-history-modal .ghr-status.is-current { background:#e9f7ef; color:#2b7c59; }
body.rm-admin #guest-history-modal .ghr-status.is-future { background:#fbf3e1; color:#7a5b1c; }
body.rm-admin #guest-history-modal .ghr-status.is-cancelled { background:#fdebed; color:#b2443b; }
body.rm-admin #guest-history-modal .guest-history-row button { margin:0; }
body.rm-admin #guest-history-modal .guest-history-empty { display:grid; justify-items:center; gap:6px; padding:28px 12px; border:1px dashed #d5dce6; border-radius:8px; background:#fff; color:var(--rm-text); text-align:center; }
body.rm-admin #guest-history-modal .guest-history-empty i { color:#9aa6b6; font-size:26px; }
body.rm-admin #guest-history-modal #guest-history-more { width:100%; margin-top:10px; }
@media (max-width:780px) {
 body.rm-admin #guest-history-modal { align-items:stretch; padding:0; }
 body.rm-admin #guest-history-modal .guest-history-card { width:100%; height:100dvh; max-height:none; border-radius:0; }
 body.rm-admin #guest-history-modal .guest-history-head { padding:max(14px, env(safe-area-inset-top)) 14px 14px; }
 body.rm-admin #guest-history-modal .guest-history-body { flex:1 1 auto; padding:12px 14px max(16px, env(safe-area-inset-bottom)); }
 body.rm-admin #guest-history-modal .guest-history-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body.rm-admin #guest-history-modal .guest-history-summary > div:last-child:nth-child(odd) { grid-column:1 / -1; } /* HISTORY-fix: 2 + 1 */
}
@media (max-width:560px) { /* HISTORY-fix: on a phone a card WITH "Ver reserva" puts the chip + button row under the stay, right-aligned */
 body.rm-admin #guest-history-modal .guest-history-row:has(.ghr-side > button) { grid-template-columns:minmax(0,1fr); gap:10px; }
}

/* Reservation modal: real-photo lightbox (header avatar and "Pessoas desta reserva" avatars). Loaded only while open. */
body.rm-admin #guest-photo-modal { z-index:140; }
body.rm-admin #guest-photo-modal:not(.hidden) { visibility:visible !important; }
body.rm-admin .guest-photo-card { position:relative; display:grid; gap:12px; width:min(420px,100%); margin:auto; padding:14px; border-radius:12px; background:#fff; }
body.rm-admin .guest-photo-card .guest-photo-close { position:absolute; top:20px; right:20px; z-index:1; background:rgba(255,255,255,.92); }
body.rm-admin .guest-photo-frame { display:grid; place-items:center; width:100%; aspect-ratio:3 / 4; max-height:70dvh; overflow:hidden; border-radius:8px; background:#eef2f6; }
body.rm-admin .guest-photo-frame img { display:block; width:100%; height:100%; object-fit:cover; }
body.rm-admin .guest-photo-frame.is-missing img { object-fit:contain; }
body.rm-admin .guest-photo-initials { display:grid; place-items:center; width:100%; height:100%; background:linear-gradient(135deg,#d6bc72,#af8c39); color:#fff; font-size:64px; font-weight:700; }
body.rm-admin .guest-photo-copy { display:grid; gap:2px; text-align:center; }
body.rm-admin .guest-photo-copy strong { color:var(--rm-primary); font-size:16px; }
body.rm-admin .guest-photo-copy small { color:var(--rm-text); font-size:12px; }
body.rm-admin #checkin-modal .checkin-person-avatar[data-guest-photo-person] { cursor:pointer; }
body.rm-admin #checkin-modal .checkin-person-avatar[data-guest-photo-person]:focus-visible,
body.rm-admin #checkin-modal .reservation-guest-summary[data-guest-history]:focus-visible { outline:2px solid var(--rm-primary); outline-offset:3px; }
body.rm-admin #checkin-modal .reservation-guest-summary[data-guest-history] { cursor:pointer; }

/* Reservation modal: "Pessoas desta reserva" now sits above "Dados financeiros" (index.php order; finance has its own slot). */
body.rm-admin .checkin-modal-card .checkin-reservation-finance:empty { display:none; }
body.rm-admin .checkin-modal-card .checkin-reservation-finance { margin:20px 0 14px; }
body.rm-admin .checkin-modal-card .checkin-reservation-details + .checkin-people-panel { margin-top:0; padding-top:0; border-top:0; }

/* Reservation modal: access codes as slim single-row cards (label | code | copy), same markup, copy and show/hide behaviour. */
body.rm-admin #checkin-modal .access-compact { display:grid; gap:8px; overflow:visible; border:0; border-radius:0; background:none; }
body.rm-admin #checkin-modal .access-row { grid-template-columns:minmax(92px,auto) minmax(0,1fr); gap:6px 12px; min-height:44px; padding:6px 6px 6px 12px; border:1px solid #d9e1ec; border-radius:8px; background:#f5f8fc; }
body.rm-admin #checkin-modal .access-row + .access-row { border-top:1px solid #d9e1ec; }
body.rm-admin #checkin-modal .access-row.emergency { border-color:#e8dbb9; background:#fcf8ee; }
body.rm-admin #checkin-modal .access-row:not(.emergency) { color:var(--rm-primary); }
body.rm-admin #checkin-modal .access-row:not(.emergency) .access-row-label > span:first-child,
body.rm-admin #checkin-modal .access-row:not(.emergency) .access-row-value code { color:var(--rm-primary); }
body.rm-admin #checkin-modal .access-row:not(.emergency) .access-row-empty { color:var(--rm-text); }
body.rm-admin #checkin-modal .access-row:not(.emergency) .access-row-extra,
body.rm-admin #checkin-modal .access-row:not(.emergency) .access-row-extra p { color:#b23836; }
body.rm-admin #checkin-modal .access-row.emergency .access-row-value code { color:#5b4214; }
body.rm-admin #checkin-modal .access-row-actions .button { height:28px; min-height:28px; }
body.rm-admin #checkin-modal .access-row-label { grid-column:1; flex-direction:column; align-items:flex-start; justify-content:center; gap:2px; }
body.rm-admin #checkin-modal .access-row-label > span:first-child { font-size:10.5px; letter-spacing:.08em; line-height:13px; }
body.rm-admin #checkin-modal .access-row-label small { font-size:10.5px; line-height:13px; }
body.rm-admin #checkin-modal .access-row-label .status-badge { min-height:18px; padding:0 6px; font-size:9.5px; }
body.rm-admin #checkin-modal .access-row-value { grid-column:2; grid-template-columns:minmax(0,1fr) 30px; gap:6px; }
body.rm-admin #checkin-modal .access-row-value code { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:16px; font-weight:650; font-variant-numeric:tabular-nums; letter-spacing:.12em; line-height:30px; text-align:right; }
body.rm-admin #checkin-modal .access-row-empty { font-size:12px; text-align:right; }
body.rm-admin #checkin-modal .access-row .access-copy { width:30px; min-width:30px; height:30px; min-height:30px; margin:0; padding:0; border:1px solid transparent; border-radius:6px; background:transparent; color:#536176; box-shadow:none; }
body.rm-admin #checkin-modal .access-row .access-copy:hover { border-color:#d0d8e3; background:#fff; color:var(--rm-primary); }
body.rm-admin #checkin-modal .access-row.emergency .access-copy:hover { border-color:#e3d3aa; color:#7a5b1c; }
body.rm-admin #checkin-modal .access-row .access-copy i { font-size:15px; }
body.rm-admin #checkin-modal .access-row-actions,
body.rm-admin #checkin-modal .access-row-extra { grid-column:1 / -1; padding:0 6px 4px 0; }
@media (max-width:620px) {
 body.rm-admin #checkin-modal .access-row { padding:5px 5px 5px 10px; }
 body.rm-admin #checkin-modal .access-row-value code { font-size:15px; }
}
/* HISTORY-fix (owner 26 Oct 2026): "Encerrar conversa no canal" left the chat header (the "+" menu carries it now; the node stays
   for cxSyncCloseButton and is never displayed). The close X is the clear primary "close": 44 px hit area, a soft-filled navy
   36 px circle with a white X, a light shadow, hover and press states; same height line as the Portaria icon next to it. */
body.rm-admin #guesty-chat-modal #guesty-chat-close-thread { display:none!important; }
body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head .guesty-chat-head-actions > .icon-button[data-close-guesty-chat] { position:relative; isolation:isolate; display:inline-grid; place-items:center; flex:0 0 44px; width:44px; min-width:44px; height:44px; margin:0 -4px 0 0; padding:0; border:0; border-radius:50%; background:transparent; color:#fff; box-shadow:none; -webkit-tap-highlight-color:transparent; }
body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head .guesty-chat-head-actions > .icon-button[data-close-guesty-chat]::before { content:""; position:absolute; inset:4px; z-index:-1; border-radius:50%; background:var(--rm-primary,#142f53); box-shadow:0 2px 6px rgba(20,47,83,.26),0 0 0 1px rgba(20,47,83,.08); transition:background-color .15s ease,box-shadow .15s ease,transform .12s ease; }
body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head .guesty-chat-head-actions > .icon-button[data-close-guesty-chat] i { color:#fff; font-size:20px; line-height:1; }
@media (hover:hover) {
 body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head .guesty-chat-head-actions > .icon-button[data-close-guesty-chat]:hover::before { background:#21497a; box-shadow:0 4px 12px rgba(20,47,83,.32),0 0 0 1px rgba(20,47,83,.08); }
}
body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head .guesty-chat-head-actions > .icon-button[data-close-guesty-chat]:active::before { background:#0e2442; transform:scale(.92); box-shadow:0 1px 3px rgba(20,47,83,.3); }
body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head .guesty-chat-head-actions > .icon-button[data-close-guesty-chat]:focus-visible { outline:none; }
body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head .guesty-chat-head-actions > .icon-button[data-close-guesty-chat]:focus-visible::before { box-shadow:0 0 0 2px #fff,0 0 0 4px #6d8fbf; }
@media (prefers-reduced-motion:reduce) {
 body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head .guesty-chat-head-actions > .icon-button[data-close-guesty-chat]::before { transition:none; }
}

/* CHAT-checkout-bar-desktop (29 Oct 2026): laptop checkout bar = wrapping row, no label overlap; a confirmed late checkout
   reads as a field (label + time below), still the same clickable control. */
@media (min-width:781px) {
 body.rm-admin .guesty-chat-head > .chat-checkout-summary { display:flex; flex-wrap:wrap; align-items:flex-start; column-gap:24px; row-gap:8px; container-type:inline-size; }
 body.rm-admin .guesty-chat-head > .chat-checkout-summary > div { flex:0 0 auto; }
 body.rm-admin .guesty-chat-head > .chat-checkout-summary > div:nth-child(2) span { margin-bottom:3px; }
 body.rm-admin .guesty-chat-head > .chat-checkout-summary > .chat-checkout-late { margin-left:auto; align-self:center; }
 body.rm-admin .guesty-chat-head > .chat-checkout-summary > .chat-checkout-late.is-set:not(.is-agendando) { align-self:flex-start; }
}
@container (max-width:470px) {
 body.rm-admin .guesty-chat-head > .chat-checkout-summary { column-gap:14px; }
 body.rm-admin .guesty-chat-head > .chat-checkout-summary .chat-checkout-late:not(.is-set) { min-height:32px; padding:6px 8px; font-size:11px; }
 body.rm-admin .guesty-chat-head > .chat-checkout-summary .chat-checkout-late:not(.is-set) svg { display:none; }
}
@container (max-width:400px) {
 body.rm-admin .guesty-chat-head > .chat-checkout-summary { column-gap:9px; }
}
body.rm-admin .chat-checkout-summary .chat-checkout-late.is-set:not(.is-agendando) { display:block; min-height:0; padding:0; border:0; border-radius:0; background:transparent; color:#87909d; font-size:12px; font-weight:400; line-height:1.4; text-align:left; }
body.rm-admin .chat-checkout-summary .chat-checkout-late.is-set:not(.is-agendando):hover { background:transparent; color:#6b7788; }
body.rm-admin .chat-checkout-summary .chat-checkout-late.is-set:not(.is-agendando) svg { display:none; }
body.rm-admin .chat-checkout-summary .chat-checkout-late.is-set:not(.is-agendando)::after { content:attr(data-late-shown); display:block; margin-top:3px; color:#1d3348; font-size:15px; font-weight:700; line-height:1.4; }
body.rm-admin .chat-checkout-summary .chat-checkout-late.is-set:not(.is-agendando):focus-visible { outline:2px solid #6d8fbf; outline-offset:3px; border-radius:4px; }
@media (max-width:780px) {
 body.rm-admin .chat-checkout-summary .chat-checkout-late.is-set:not(.is-agendando) { font-size:10px; }
 body.rm-admin .chat-checkout-summary .chat-checkout-late.is-set:not(.is-agendando)::after { font-size:12px; }
}

/* LATE-note-overlap (30 Oct 2026): the chat head (sticky .modal-head, z-index 2) stacks above its own list, so the late-checkout
   popover opened from the checkout bar is never painted under the sticky day chip (z-index 3) or the bubbles. */
body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head { z-index:8; }

/* GUEST-block (1 Nov 2026): Bloquear / Desbloquear in the guest history sheet. */
body.rm-admin #guest-history-modal .guest-history-block { display:grid; gap:10px; margin:4px 0 14px; padding:12px 14px; border:1px solid #e4e7ec; border-radius:12px; background:#fff; }
body.rm-admin #guest-history-modal .guest-history-block[hidden] { display:none; }
body.rm-admin #guest-history-modal .guest-history-block.is-blocked { border-color:#f1c4c0; background:#fdf3f2; }
body.rm-admin #guest-history-modal .ghb-state { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
body.rm-admin #guest-history-modal .ghb-state[hidden], body.rm-admin #guest-history-modal .ghb-confirm[hidden] { display:none; }
body.rm-admin #guest-history-modal .ghb-badge { padding:3px 9px; border-radius:999px; background:#b2443b; color:#fff; font-size:12px; font-weight:700; }
body.rm-admin #guest-history-modal .ghb-state small { color:#6b7788; font-size:12px; }
body.rm-admin #guest-history-modal .ghb-confirm { display:grid; gap:6px; padding:10px 12px; border-radius:10px; background:#f5f6f8; }
body.rm-admin #guest-history-modal .ghb-confirm.is-danger { background:#fdebed; color:#7a2620; }
body.rm-admin #guest-history-modal .ghb-confirm strong { font-size:14px; }
body.rm-admin #guest-history-modal .ghb-confirm ul { margin:0; padding-left:18px; font-size:13px; line-height:1.45; }
body.rm-admin #guest-history-modal .ghb-actions { display:flex; justify-content:flex-end; gap:8px; }
body.rm-admin #guest-history-modal .ghb-main.is-danger { border-color:#b2443b; background:#b2443b; color:#fff; }
body.rm-admin #guest-history-modal .ghb-main.is-danger:hover { background:#963830; }
/* GUEST-block-css1 (1 Nov 2026, owner): the Admin .button display rule beat the hidden attribute ("Cancelar" showed before the
   confirmation was opened). */
body.rm-admin #guest-history-modal .guest-history-block [hidden] { display:none !important; }

/* MSG-translate (2 Nov 2026): translated bubbles (both texts, a class flips them) and the reply-translation switch. */
body.rm-admin .chat-tr .chat-tr-orig, body.rm-admin .chat-tr .chat-tr-b { display:none; }
body.rm-admin .guesty-chat-message.is-tr-original .chat-tr-shown, body.rm-admin .guesty-chat-message.is-tr-original .chat-tr-a { display:none; }
body.rm-admin .guesty-chat-message.is-tr-original .chat-tr-orig, body.rm-admin .guesty-chat-message.is-tr-original .chat-tr-b { display:inline; }
body.rm-admin .guesty-chat-message.is-tr-original .chat-tr-orig { display:block; }
body.rm-admin .chat-tr p { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
body.rm-admin .chat-tr-toggle { display:block; margin:6px 0 0; padding:0; border:0; background:transparent; color:inherit; opacity:.72; font:inherit; font-size:11.5px; text-decoration:underline; text-underline-offset:2px; cursor:pointer; text-align:left; }
body.rm-admin .chat-tr-toggle:hover { opacity:1; }
body.rm-admin .chat-tr-bar { display:flex; align-items:center; gap:8px; margin:0 12px 6px; padding:6px 10px; border-radius:10px; background:#eef4fb; color:#1d3348; font-size:12.5px; }
body.rm-admin .chat-tr-bar[hidden] { display:none; }
body.rm-admin .chat-tr-bar.is-off { background:#f3f4f6; color:#6b7788; }
body.rm-admin .chat-tr-bar span { flex:1 1 auto; min-width:0; }
body.rm-admin .chat-tr-bar button { flex:0 0 auto; padding:4px 10px; border:1px solid #c9d6e6; border-radius:8px; background:#fff; color:#1d3348; font:inherit; font-weight:600; cursor:pointer; }

/* MSG-translate-bar (2 Nov 2026, owner): a nicer reply-translation bar (Madalena navy/gold, globe icon, switch). */
body.rm-admin .chat-tr-bar { gap:12px; margin:0 12px 8px; padding:8px 10px 8px 8px; border:1px solid #dfe6f0; border-radius:14px;
  background:linear-gradient(180deg,#ffffff 0%,#f6f8fc 100%); box-shadow:0 1px 2px rgba(29,51,72,.06); color:#1d3348; font-size:12.5px; }
body.rm-admin .chat-tr-icon { display:grid; place-items:center; flex:0 0 32px; width:32px; height:32px; border-radius:50%; background:#1d3348; color:#d9c28e; }
body.rm-admin .chat-tr-copy { display:grid; gap:1px; flex:1 1 auto; min-width:0; }
body.rm-admin .chat-tr-copy strong { font-size:13px; font-weight:700; line-height:1.25; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
body.rm-admin .chat-tr-copy small { color:#6b7788; font-size:11.5px; line-height:1.3; }
body.rm-admin .chat-tr-switch { position:relative; flex:0 0 auto; width:40px; height:24px; padding:0; border:0; border-radius:999px; background:#1d3348; cursor:pointer; transition:background .18s ease; }
body.rm-admin .chat-tr-knob { position:absolute; top:3px; left:19px; width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.25); transition:left .18s ease; }
body.rm-admin .chat-tr-switch[aria-checked="false"] { background:#c7cfdb; }
body.rm-admin .chat-tr-switch[aria-checked="false"] .chat-tr-knob { left:3px; }
body.rm-admin .chat-tr-switch:focus-visible { outline:2px solid #6d8fbf; outline-offset:2px; }
body.rm-admin .chat-tr-bar.is-off { background:#f6f7f9; color:#4b5563; }
body.rm-admin .chat-tr-bar.is-off .chat-tr-icon { background:#e5e8ee; color:#8a94a3; }
body.rm-admin .chat-tr-bar.is-busy .chat-tr-switch { opacity:.6; cursor:progress; }
@media (prefers-reduced-motion: reduce) { body.rm-admin .chat-tr-switch, body.rm-admin .chat-tr-knob { transition:none; } }

/* WA-contact-doc (3 Nov 2026, owner): WhatsApp documents and shared contact cards in the chat. */
body.rm-admin .chat-doc { display:flex; align-items:center; gap:10px; width:100%; min-width:220px; max-width:320px; margin:2px 0 6px; padding:8px 10px 8px 8px;
  border:1px solid rgba(29,51,72,.12); border-radius:12px; background:rgba(255,255,255,.75); color:#1d3348; text-align:left; font:inherit; cursor:pointer; }
body.rm-admin .chat-doc.is-waiting { cursor:default; opacity:.8; }
body.rm-admin .chat-doc.is-failed { opacity:.65; }
body.rm-admin .chat-doc-icon { position:relative; display:grid; place-items:center; flex:0 0 38px; width:38px; height:44px; border-radius:8px; background:#1d3348; color:#d9c28e; }
body.rm-admin .chat-doc-icon i { font-size:18px; margin-top:-8px; }
body.rm-admin .chat-doc-icon b { position:absolute; bottom:4px; left:0; right:0; font-size:9px; font-weight:800; letter-spacing:.04em; text-align:center; color:#fff; }
body.rm-admin .chat-doc-copy { display:grid; gap:2px; min-width:0; flex:1 1 auto; }
body.rm-admin .chat-doc-copy strong { font-size:13px; font-weight:700; line-height:1.25; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body.rm-admin .chat-doc-copy small { font-size:11.5px; color:#6b7788; }
body.rm-admin .chat-doc-go { color:#8a94a3; font-size:18px; }
body.rm-admin .chat-card { display:grid; gap:8px; min-width:230px; max-width:320px; margin:2px 0 6px; padding:10px; border:1px solid rgba(29,51,72,.12); border-radius:12px; background:rgba(255,255,255,.75); color:#1d3348; }
body.rm-admin .chat-card + .chat-card { margin-top:6px; }
body.rm-admin .chat-card-head, body.rm-admin .chat-card.is-legacy { display:flex; align-items:center; gap:10px; }
body.rm-admin .chat-card-avatar { display:grid; place-items:center; flex:0 0 38px; width:38px; height:38px; border-radius:50%; background:#1d3348; color:#d9c28e; font-size:14px; font-weight:800; }
body.rm-admin .chat-card-copy { display:grid; gap:1px; min-width:0; }
body.rm-admin .chat-card-copy strong { font-size:14px; font-weight:700; line-height:1.25; overflow-wrap:anywhere; }
body.rm-admin .chat-card-copy small { font-size:11.5px; color:#6b7788; overflow-wrap:anywhere; }
body.rm-admin .chat-card-phone { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; padding-top:8px; border-top:1px solid rgba(29,51,72,.08); font-size:13px; }
body.rm-admin .chat-card-phone em { font-style:normal; font-size:11px; color:#8a94a3; }
body.rm-admin .chat-card-actions { display:flex; align-items:center; gap:6px; }
body.rm-admin .chat-card-open { display:inline-flex; align-items:center; gap:5px; min-height:32px; padding:0 12px; border:0; border-radius:999px; background:#1f8f4e; color:#fff; font:inherit; font-size:12.5px; font-weight:700; cursor:pointer; }
body.rm-admin .chat-card-open[aria-busy="true"] { opacity:.6; cursor:progress; }
body.rm-admin .chat-card-call { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; background:#eef1f6; color:#1d3348; text-decoration:none; }
body.rm-admin .media-gallery-kind.is-document { color:#1d3348; }

/* WA-fail-reason / WA-fail-style (3 Nov 2026, owner): the reason under a WhatsApp message that was not sent. Own elements
   (no <small>, so the bubble footer rules do not apply) and a white card that reads the same on the light and dark bubbles. */
body.rm-admin .guesty-chat-bubble .chat-fail-reason { display:flex; gap:8px; align-items:flex-start; margin:10px 0 0; padding:10px 12px; border-radius:12px; background:#fff; color:#3d4a5c; text-align:left; box-shadow:0 1px 2px rgba(16,24,40,.08); }
body.rm-admin .guesty-chat-bubble .chat-fail-reason > i { flex:0 0 auto; font-size:17px; line-height:18px; color:#c2412d; }
body.rm-admin .guesty-chat-bubble .chat-fail-copy { display:flex; flex-direction:column; gap:3px; min-width:0; }
body.rm-admin .guesty-chat-bubble .chat-fail-title { color:#9f2f1f; font-size:13px; font-weight:700; line-height:18px; }
body.rm-admin .guesty-chat-bubble .chat-fail-hint { color:#4a5668; font-size:12.5px; font-weight:400; line-height:1.4; }
body.rm-admin .guesty-chat-bubble .chat-fail-code { color:#8b93a1; font-size:11px; font-weight:600; line-height:14px; }

/* CHAT-checkin-ring (3 Nov 2026, owner): avatar ring = check-in done (green) / pending (grey). */
body.rm-admin #guesty-chat-avatar[data-checkin-state="done"],
body.rm-admin .guest-history-avatar[data-checkin-state="done"] { --chat-checkin-color:#2b7c59; --chat-checkin-glow:rgba(43,124,89,.34); }
body.rm-admin #guesty-chat-avatar[data-checkin-state="pending"],
body.rm-admin .guest-history-avatar[data-checkin-state="pending"] { --chat-checkin-color:#9aa1ad; --chat-checkin-glow:rgba(107,114,128,.18); }
body.rm-admin .guesty-chat-day.is-system[data-key^="ci:"] i { color:#2b7c59; }

/* MSGFIX HDR-5 / HDR-4 (19 Nov 2026): one fact bar in the chat head. The stay strip, the checkout bar and the turnover rows
   share the stay strip's scale (caption 10px/1.2, value 12px/650/1.4, 3px between them), the same padding and the same
   single-row height (41px), so the head keeps its height when one replaces another. Each bar keeps its own columns. */
body.rm-admin .guesty-chat-card .guesty-chat-head > .guesty-chat-stay,
body.rm-admin .guesty-chat-card .guesty-chat-head > .chat-checkout-summary { box-sizing:border-box; min-height:41px; margin-top:0; padding:7px 0 1px; border-top:1px solid #eef0f4; }
body.rm-admin .guesty-chat-card .guesty-chat-head > .guesty-chat-stay.is-pending { visibility:hidden; }
body.rm-admin .guesty-chat-card .guesty-chat-head > #chat-concurrent-stays .chat-concurrent-row { box-sizing:border-box; min-height:41px; padding:7px 0 1px; border-top-color:#eef0f4; }
body.rm-admin .guesty-chat-card .guesty-chat-head > #chat-concurrent-stays .chat-concurrent-row > span { gap:3px; }
body.rm-admin .guesty-chat-card .guesty-chat-head > .chat-checkout-summary > div > span,
body.rm-admin .guesty-chat-card .guesty-chat-head > #chat-concurrent-stays .chat-concurrent-row small { font-size:10px; line-height:1.2; }
body.rm-admin .guesty-chat-card .guesty-chat-head > .chat-checkout-summary > div > strong,
body.rm-admin .guesty-chat-card .guesty-chat-head > #chat-concurrent-stays .chat-concurrent-row strong { font-size:12px; font-weight:650; line-height:1.4; }
body.rm-admin .guesty-chat-card .guesty-chat-head > .chat-checkout-summary > div:nth-child(2) { font-size:12px; line-height:1.4; }
body.rm-admin .guesty-chat-card .guesty-chat-head > .chat-checkout-summary > div:nth-child(2) > strong,
body.rm-admin .guesty-chat-card .guesty-chat-head > .chat-checkout-summary > div:nth-child(2) > small { font-size:inherit; font-weight:650; line-height:1.4; }
body.rm-admin .guesty-chat-card .guesty-chat-head > .chat-checkout-summary .chat-checkout-late.is-set:not(.is-agendando) { font-size:10px; line-height:1.2; }
body.rm-admin .guesty-chat-card .guesty-chat-head > .chat-checkout-summary .chat-checkout-late.is-set:not(.is-agendando)::after { font-size:12px; font-weight:650; line-height:1.4; }
/* The Late checkout button keeps its touch height without making its row taller than the other bars. */
body.rm-admin .guesty-chat-card .guesty-chat-head > .chat-checkout-summary .chat-checkout-late:not(.is-set):not(.is-agendando) { margin-top:-3px; margin-bottom:-3px; }
@media (max-width:360px) {
 body.rm-admin .guesty-chat-card .guesty-chat-head > .chat-checkout-summary > div > span { font-size:9px; }
 body.rm-admin .guesty-chat-card .guesty-chat-head > .chat-checkout-summary > div:nth-child(2) { font-size:10.5px; }
 body.rm-admin .guesty-chat-card .guesty-chat-head > #chat-concurrent-stays .chat-concurrent-row strong { font-size:11px; }
}

/* MSGFIX HDR-7 (19 Nov 2026): the chat head is opaque white, so the generic .modal-head blur(12px) painted nothing and only
   forced a backdrop layer under a sheet that slides with transform. No backdrop-filter on it, at rest or in motion. */
body.rm-admin .guesty-chat-card .modal-head.guesty-chat-head { -webkit-backdrop-filter:none; backdrop-filter:none; background-color:#fff; }
/* MSGFIX HDR-6 (D6): the sheet's own layer exists only while it slides (entry, back to the list, close) and takes no taps
   while it leaves. On a phone the page under a leaving sheet is shown again for the slide (a settled sheet hides it). */
body.rm-admin.rm-chat-entering #guesty-chat-modal,
body.rm-admin.rm-chat-returning #guesty-chat-modal,
body.rm-admin.rm-chat-leaving #guesty-chat-modal { will-change:transform; }
body.rm-admin.rm-chat-leaving #guesty-chat-modal,
body.rm-admin.rm-chat-leaving #guesty-chat-modal .guesty-chat-card { pointer-events:none; }
html.rm-sheet-open body.rm-admin.rm-chat-leaving > .rm-behind-sheet,
html.rm-sheet-open body.rm-admin.rm-chat-retaking > .rm-behind-sheet { visibility:visible !important; }
