/* Live help (2026-11-02), staff only, on the Finances page's base (finances.css) like Support calls: the staff member's
   availability, the customers who were offered help or asked for a person, and one customer's chat with a reply box.
   44px targets, text at least 14px. */

[hidden] { display: none !important; }
#status.bad { color: var(--bad); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Availability */
.lh-presence { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-start; }
.lh-presence-main { flex: 1 1 360px; min-width: 0; }
.lh-presence-side { flex: 1 1 320px; min-width: 0; }
.lh-presence h2 { margin: 0 0 4px; }
.lh-name-row { margin-top: 10px; }
.lh-name-row label { display: block; font-weight: 600; margin-bottom: 4px; }
.lh-row { display: flex; gap: 8px; }
.lh-row input { flex: 1 1 160px; min-width: 0; }
.lh-hours { display: flex; flex-wrap: wrap; gap: 8px; }
.lh-hours button { min-height: 44px; }
.lh-hours button[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: #fff; }
.lh-presence-note { margin: 10px 0 0; font-weight: 600; }
.lh-presence-note.on { color: var(--good); }

/* The list and the chat */
.lh-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; align-items: start; }
.lh-list { min-width: 0; }
.lh-list h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.count:empty { display: none; }
.lh-requests { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.lh-row-btn { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; width: 100%; min-height: 44px; padding: 12px 14px; text-align: left;
  font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.lh-row-btn:hover { border-color: #a9d3e6; background: #fbfdfe; }
.lh-row-btn[aria-current="true"] { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); background: #f2fafd; }
.lh-row-btn .who { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.lh-row-btn .what { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }
.lh-row-btn.wants { border-color: #f0c98a; background: linear-gradient(180deg, var(--warn-bg), #fff 70%); }
.tag { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 14px; font-weight: 700; background: #eef2f5; color: var(--muted); white-space: nowrap; }
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.info { background: #e6f2f8; color: #0b5a7a; }
.lh-empty { margin-top: 10px; }

.lh-chat { margin: 0; min-width: 0; }
.lh-back { display: none; margin: -6px 0 6px -8px; }
.lh-chat-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: flex-start; }
.lh-chat-head h2 { margin: 0 0 2px; overflow-wrap: anywhere; }
.lh-chat-head p { margin: 2px 0; }
.lh-account { margin: 0 0 0 -8px; }
.lh-chat-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lh-chat-actions button { min-height: 44px; }
.lh-messages { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow: auto;
  padding-right: 4px; scroll-behavior: smooth; }
.lh-msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; background: #f1f3f5; align-self: flex-start; }
.lh-msg .speaker { display: block; font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.lh-msg .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.lh-msg .at { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
.lh-msg.customer { background: var(--brand); color: #fff; align-self: flex-end; }
.lh-msg.customer .speaker, .lh-msg.customer .at { color: #fff; }
.lh-msg.staff { background: #e6f2f8; border: 1px solid #a9d3e6; }
.lh-msg.event { align-self: center; background: #fff3cd; color: #6b4e00; font-size: 14px; padding: 6px 12px; }
.lh-say { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.lh-say textarea { flex: 1 1 auto; min-height: 44px; resize: vertical; }
.lh-say button { min-height: 44px; }
.lh-placeholder { margin: 0; color: var(--muted); display: grid; place-items: center; min-height: 160px; }

.toast { position: fixed; left: 50%; bottom: 20px; font-size: 14px; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; z-index: 30; max-width: calc(100vw - 32px); }

@media (max-width: 899px) {
  .lh-layout { grid-template-columns: 1fr; }
  .lh-layout.showing-chat .lh-list, .lh-layout.showing-chat .lh-placeholder { display: none; }
  .lh-layout:not(.showing-chat) .lh-chat { display: none; }
  .lh-back { display: inline-flex; }
  .lh-messages { max-height: none; }
  .lh-placeholder { display: none; }
  .toast { bottom: auto; top: 12px; }
}
