/* LFC Messages panel (shared by the company app, the office app and The Front Porch) */
.lfm-ov { --lfm-bg: #F4F6F9; --lfm-sf: #FFFFFF; --lfm-sf2: #F7F9FC; --lfm-tx: #13202F; --lfm-tx2: #5B6675; --lfm-bd: #DCE2EA; --lfm-navy: #123B67; --lfm-or: #F39200; --lfm-on: #FFFFFF;
  position: fixed; inset: 0; z-index: 9000; background: rgba(10, 22, 38, .45); display: flex; align-items: center; justify-content: center; padding: 24px; font-family: Poppins, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; color: var(--lfm-tx); }
.lfm-ov[hidden] { display: none; }
.lfm-ov.dark { --lfm-bg: #0E141B; --lfm-sf: #17202A; --lfm-sf2: #1B2530; --lfm-tx: #E7ECF2; --lfm-tx2: #95A2B1; --lfm-bd: #2D3946; --lfm-navy: #2E6BB0; }
body.lfm-lock { overflow: hidden; }
.lfm-panel { width: min(1180px, 100%); height: min(820px, 100%); background: var(--lfm-sf); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); display: flex; flex-direction: column; overflow: hidden; position: relative; }
.lfm-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--lfm-bd); }
.lfm-h h2 { margin: 0; font-size: 20px; color: var(--lfm-navy); }
.ov.dark .lfm-h h2, .lfm-ov.dark .lfm-h h2 { color: var(--lfm-tx); }
.lfm-h-a { display: flex; gap: 8px; align-items: center; }
.lfm-btn { font: inherit; font-size: 13.5px; font-weight: 600; border: 1px solid var(--lfm-bd); background: var(--lfm-sf); color: var(--lfm-tx); border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.lfm-btn.pri { background: var(--lfm-or); border-color: var(--lfm-or); color: #0B2747; }
.lfm-x { border: 0; background: var(--lfm-sf2); color: var(--lfm-tx); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.lfm-x svg, .lfm-back svg, .lfm-tools svg { width: 18px; height: 18px; }
.lfm-cols { flex: 1; display: grid; grid-template-columns: 300px 1fr; min-height: 0; }
.lfm-list { border-right: 1px solid var(--lfm-bd); display: flex; flex-direction: column; min-height: 0; background: var(--lfm-sf2); }
.lfm-search { display: block; padding: 12px 12px 8px; }
.lfm-search input { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--lfm-bd); border-radius: 10px; background: var(--lfm-sf); color: var(--lfm-tx); }
.lfm-seg { display: flex; margin: 0 12px 8px; background: var(--lfm-sf); border: 1px solid var(--lfm-bd); border-radius: 10px; padding: 3px; }
.lfm-seg button { flex: 1; font: inherit; font-size: 12.5px; font-weight: 600; border: 0; background: transparent; color: var(--lfm-tx2); padding: 6px; border-radius: 8px; cursor: pointer; }
.lfm-seg button.on { background: var(--lfm-navy); color: #fff; }
.lfm-rows { overflow-y: auto; flex: 1; padding: 0 6px 10px; }
.lfm-row { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; font: inherit; color: inherit; border: 0; background: transparent; padding: 10px 8px; border-radius: 12px; cursor: pointer; }
.lfm-row:hover { background: var(--lfm-sf); }
.lfm-row.on { background: var(--lfm-sf); box-shadow: inset 3px 0 0 var(--lfm-or); }
.lfm-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lfm-row-top { display: flex; gap: 6px; align-items: center; min-width: 0; }
.lfm-row-top b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lfm-row.unread b { color: var(--lfm-navy); }
.lfm-ov.dark .lfm-row.unread b { color: #fff; }
.lfm-prev { font-size: 12.5px; color: var(--lfm-tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lfm-row.unread .lfm-prev { color: var(--lfm-tx); font-weight: 600; }
.lfm-row-m { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.lfm-row-m small { font-size: 11.5px; color: var(--lfm-tx2); white-space: nowrap; }
.lfm-pill { font-style: normal; background: var(--lfm-or); color: #0B2747; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; min-width: 18px; text-align: center; }
.lfm-tag { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; color: var(--lfm-tx2); border: 1px solid var(--lfm-bd); border-radius: 6px; padding: 1px 5px; white-space: nowrap; flex: none; }
.lfm-av { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: #5B6675; }
.lfm-av.t-staff { background: #123B67; } .lfm-av.t-client { background: #F39200; color: #0B2747; } .lfm-av.t-host { background: #0E7C86; } .lfm-av.t-contact { background: #2E7D4F; } .lfm-av.t-group { background: #5B6675; font-size: 11px; }
.lfm-th { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.lfm-th-h { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--lfm-bd); }
.lfm-th-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lfm-th-t b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lfm-th-t small { font-size: 12px; color: var(--lfm-tx2); }
.lfm-back { display: none; border: 0; background: transparent; color: var(--lfm-tx); padding: 6px; cursor: pointer; }
.lfm-tools { display: flex; gap: 4px; }
.lfm-tools button { border: 1px solid var(--lfm-bd); background: var(--lfm-sf); color: var(--lfm-tx); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.lfm-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--lfm-bg); }
.lfm-b { max-width: 72%; align-self: flex-start; background: var(--lfm-sf); border: 1px solid var(--lfm-bd); border-radius: 14px 14px 14px 4px; padding: 8px 12px; }
.lfm-b.mine { align-self: flex-end; background: var(--lfm-navy); border-color: var(--lfm-navy); color: #fff; border-radius: 14px 14px 4px 14px; }
.lfm-who { font-size: 11.5px; font-weight: 600; color: var(--lfm-tx2); margin-bottom: 2px; }
.lfm-text { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.lfm-job { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #FFF2DE; color: #8A4B00; }
.lfm-time { font-size: 10.5px; opacity: .7; margin-top: 4px; text-align: right; }
.lfm-comp { border-top: 1px solid var(--lfm-bd); padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.lfm-comp textarea, .lfm-quick textarea { font: inherit; font-size: 14px; width: 100%; box-sizing: border-box; resize: vertical; border: 1px solid var(--lfm-bd); border-radius: 10px; padding: 9px 12px; background: var(--lfm-sf); color: var(--lfm-tx); }
.lfm-comp-r { display: flex; gap: 8px; }
.lfm-comp-r select, .lfm-f select, .lfm-f input { font: inherit; font-size: 13.5px; border: 1px solid var(--lfm-bd); border-radius: 10px; padding: 8px 10px; background: var(--lfm-sf); color: var(--lfm-tx); min-width: 0; }
.lfm-comp-r select { flex: 1; }
.lfm-send { font: inherit; font-weight: 700; font-size: 14px; border: 0; border-radius: 10px; padding: 9px 22px; background: var(--lfm-or); color: #0B2747; cursor: pointer; }
.lfm-send:disabled { background: #C9D0DA; color: #6B7684; cursor: not-allowed; }
.lfm-note { font-size: 12px; color: var(--lfm-tx2); margin: 0; }
.lfm-err { font-size: 12.5px; color: #B42318; margin: 0; }
.lfm-ok { font-size: 13px; color: #1E6B3A; background: #E8F5EC; border-radius: 10px; padding: 8px 12px; margin: 0; }
.lfm-warn { font-size: 12.5px; color: #8A4B00; background: #FFF2DE; border-radius: 10px; padding: 8px 12px; margin: 0; }
.lfm-ro { border-top: 1px solid var(--lfm-bd); padding: 14px 16px; font-size: 13px; color: var(--lfm-tx2); background: var(--lfm-sf2); }
.lfm-none, .lfm-empty { color: var(--lfm-tx2); font-size: 13.5px; }
.lfm-none { margin: auto; padding: 30px; text-align: center; }
.lfm-empty { padding: 14px; margin: 0; }
.lfm-pick { overflow-y: auto; flex: 1; padding-bottom: 14px; }
.lfm-grp { padding: 0 12px; }
.lfm-grp-h { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lfm-tx2); padding: 12px 6px 6px; }
.lfm-person { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; font: inherit; color: inherit; border: 0; background: transparent; padding: 8px 6px; border-radius: 12px; cursor: pointer; }
.lfm-person:hover { background: var(--lfm-sf2); }
.lfm-person > span:not(.lfm-av) { display: flex; flex-direction: column; }
.lfm-person b { font-size: 14px; } .lfm-person small { font-size: 12px; color: var(--lfm-tx2); }
.lfm-mail-ov { position: absolute; inset: 0; background: rgba(10, 22, 38, .35); display: grid; place-items: center; padding: 16px; }
.lfm-mail { background: var(--lfm-sf); border-radius: 14px; padding: 18px; width: min(460px, 100%); display: flex; flex-direction: column; gap: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.lfm-mail h3 { margin: 0; font-size: 17px; }
.lfm-mail-a, .lfm-quick-a { display: flex; gap: 8px; align-items: center; }
.lfm-f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--lfm-tx2); }
.lfm-f[hidden] { display: none; }
.lfm-print { position: fixed; width: 0; height: 0; border: 0; left: -9999px; }
/* Quick message card (client overview) */
.lfm-quick { --lfm-sf: transparent; --lfm-bd: #D3DAE4; --lfm-tx: inherit; --lfm-tx2: #5B6675; --lfm-or: #F39200; display: flex; flex-direction: column; gap: 10px; }
.lfm-quick .lfm-f select, .lfm-quick textarea { background: #fff; color: #13202F; }
.lfm-quick-a { justify-content: space-between; }
.lfm-quick-list { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--lfm-bd); padding-top: 10px; }
.lfm-qm { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; font-size: 13px; align-items: baseline; }
.lfm-qm span { overflow-wrap: anywhere; } .lfm-qm small { color: var(--lfm-tx2); font-size: 11px; } .lfm-qm.mine b { color: #123B67; }
/* Header button + badge (both apps) */
.lfm-hbtn { position: relative; }
.lfm-badge { position: absolute; top: -5px; right: -5px; background: #D92D20; color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 99px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; box-sizing: border-box; }
/* Phones: one column at a time (list → thread, with a back arrow); 16px fields so iPhone doesn't zoom */
@media (max-width: 760px) {
  .lfm-ov { padding: 0; }
  .lfm-panel { width: 100%; height: 100%; border-radius: 0; }
  .lfm-cols { grid-template-columns: 1fr; }
  .lfm-panel:not(.has-cur) .lfm-th { display: none; }
  .lfm-panel.has-cur .lfm-list { display: none; }
  .lfm-back { display: block; }
  .lfm-b { max-width: 86%; }
  .lfm-search input, .lfm-comp textarea, .lfm-comp-r select, .lfm-f select, .lfm-f input, .lfm-quick textarea { font-size: 16px; }
  .lfm-comp-r { flex-wrap: wrap; } .lfm-comp-r select { flex-basis: 100%; }
  .lfm-h .lfm-btn { padding: 8px 10px; }
}

.lfm-quick .lfm-qm { display: flex; flex-direction: column; gap: 1px; grid-template-columns: none; }
.lfm-quick .lfm-qm small { font-size: 11.5px; } .lfm-quick .lfm-qm span { font-size: 13.5px; }
.lfm-link { border: 0; background: none; padding: 0; color: var(--lfm-navy); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; align-self: flex-start; }

/* Add people to a private conversation */
.lfm-sys { align-self: center; text-align: center; font-size: 12px; color: var(--lfm-tx2); background: var(--lfm-sf2); border-radius: 99px; padding: 4px 12px; margin: 4px auto; max-width: 90%; }
.lfm-addp input { width: 18px; height: 18px; flex: none; accent-color: var(--lfm-navy); margin: 0 2px 0 4px; }
.lfm-add-f { position: sticky; bottom: 0; padding: 10px 16px; background: var(--lfm-sf); border-top: 1px solid var(--lfm-bd); display: flex; justify-content: flex-end; }
.lfm-pick .lfm-note { padding: 0 16px; }
.lfm-pick .lfm-err { padding: 0 16px; }

/* Phone: full screen, big touch targets, the composer always in reach */
@media (max-width: 760px) {
  .lfm-panel { height: 100dvh; }
  .lfm-h { padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
  .lfm-h h2 { font-size: 18px; }
  .lfm-th { min-height: 0; display: flex; flex-direction: column; }
  .lfm-th-h { padding: 8px 10px; gap: 8px; flex-wrap: nowrap; }
  .lfm-th-t { min-width: 0; flex: 1; }
  .lfm-th-t b, .lfm-th-t small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lfm-th-h > .lfm-av { display: none; }
  .lfm-tools { gap: 2px; flex: none; }
  .lfm-tools button { width: 34px; height: 34px; }
  .lfm-tools [data-print] { display: none; }
  .lfm-back { width: 36px; height: 36px; flex: none; display: grid !important; place-items: center; }
  .lfm-body { padding: 12px; flex: 1; min-height: 0; }
  .lfm-comp { padding: 8px 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .lfm-comp textarea { min-height: 44px; }
  .lfm-comp-r { gap: 6px; } .lfm-comp-r select { font-size: 14px; height: 38px; }
  .lfm-send { height: 40px; min-width: 76px; }
  .lfm-note { font-size: 11px; }
  .lfm-row { padding: 12px; }
  .lfm-person { padding: 12px 8px; }
}
@media (max-width: 760px) {
  .lfm-cols { grid-template-columns: minmax(0, 1fr); }
  .lfm-list, .lfm-th { min-width: 0; border-right: 0; }
  .lfm-row-top { flex-wrap: nowrap; } .lfm-row-top .lfm-tag { flex: none; }
  .lfm-comp-r .lfm-send { margin-left: auto; }
}
/* Seen receipts and "is typing" (2026-11-17) */
.lfm-seen { align-self: flex-end; margin: -6px 4px 0 auto; font-size: 11.5px; color: var(--lfm-muted, #6b7a90); text-align: right; }
.lfm-seen.seen { color: var(--lfm-navy); font-weight: 600; }
.lfm-typing { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 6px; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--lfm-sf); border: 1px solid var(--lfm-bd); opacity: .9; font-size: 12.5px; max-width: 80%; }
.lfm-typing[hidden] { display: none; }
.lfm-dots { display: inline-flex; gap: 3px; }
.lfm-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; animation: lfmDot 1.2s infinite ease-in-out; }
.lfm-dots i:nth-child(2) { animation-delay: .15s; } .lfm-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes lfmDot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: .9; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .lfm-dots i { animation: none; opacity: .6; } }
.lfm-prev.typing { color: var(--lfm-navy); font-style: italic; }
.dark .lfm-seen.seen, .dark .lfm-prev.typing { color: #9cc3ff; }
