/* The messenger (chat) of the law system: conversations, groups, photos, voice notes and calls.
   Loaded after MudBlazor.min.css and app.css, on every page (calls ring everywhere).
   Every class starts with "lc-". The colours come from the system's own palette. */
:root {
    --lc-accent: #94731F;   /* the gold of the brand, deep enough for white text on it */
    --lc-navy: #0A2540;
    --lc-border: #E5E9EF;
}
.lc-ltr { direction: ltr; }
.lc-mono { font-family: Consolas, "Segoe UI Mono", monospace; letter-spacing: .02em; }
.lc-muted { color: #6B7280; }
/* directional icons (the send arrow) point with the writing direction */
[dir="rtl"] .lc-flip-rtl { transform: scaleX(-1); }
[dir="rtl"] .mud-button-root.lc-flip-rtl { transform: none; }
[dir="rtl"] .mud-button-root.lc-flip-rtl .mud-icon-root { transform: scaleX(-1); }

/* ══ internal messenger ══ */
.lc-chat { display: flex; height: calc(100vh - 178px); min-height: 480px; overflow: hidden; }
.lc-chat-side { width: 320px; flex: none; border-inline-end: 1px solid var(--lc-border); display: flex; flex-direction: column; background: #FAFBFC; }
.lc-chat-search { display: flex; align-items: center; gap: 8px; margin: 12px 12px 8px; background: #fff; border: 1.5px solid var(--lc-border); border-radius: 12px; padding: 0 10px; height: 40px; color: #7B8494; }
.lc-chat-search:focus-within { border-color: var(--lc-navy); }
.lc-chat-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: #111827; }
.lc-chat-channels { display: flex; gap: 6px; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: none; }
.lc-chat-channels button { flex: none; border: 1px solid var(--lc-border); background: #fff; color: #4B5563; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .74rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.lc-chat-channels button.on { background: var(--lc-navy); color: #fff; border-color: var(--lc-navy); }
.lc-chat-threads { flex: 1; overflow: auto; padding: 0 8px 8px; }
.lc-thread { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 14px; background: transparent; cursor: pointer; font: inherit; text-align: start; transition: background .12s; }
.lc-thread:hover { background: #F0F3F7; }
.lc-thread.on { background: #fff; box-shadow: 0 4px 14px rgba(15,42,68,.08); }
.lc-thread-avatar { width: 40px; height: 40px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: #E8EEF3; color: var(--lc-navy); font-family: Consolas, monospace; font-weight: 700; font-size: .85rem; }
.lc-thread-avatar.all { background: var(--lc-accent); color: #fff; }
.lc-thread-avatar.gen { background: #F3F6F9; color: #6B7280; }
.lc-thread-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lc-thread-top { display: flex; align-items: baseline; gap: 8px; }
.lc-thread-title { flex: 1; font-weight: 700; color: #111827; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-thread-time { font-size: .7rem; color: #9CA3AF; white-space: nowrap; }
.lc-thread-last { font-size: .76rem; color: #6B7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-thread-badge { flex: none; min-width: 20px; height: 20px; border-radius: 999px; background: var(--lc-accent); color: #fff; font-size: .7rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.lc-chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }
.lc-chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--lc-border); }
.lc-chat-head-body { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .9rem; }
.lc-chat-head-body .lc-muted { font-size: .74rem; }
.lc-chat-stream { flex: 1; overflow: auto; padding: 14px 16px; background: #F3F6F9 radial-gradient(circle at 1px 1px, rgba(15,42,68,.06) 1px, transparent 0) 0 0 / 18px 18px; display: flex; flex-direction: column; gap: 4px; }
.lc-chat-panel { display: flex; flex-direction: column; border: 1px solid var(--lc-border); border-radius: 14px; overflow: hidden; }
.lc-chat-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; color: #9CA3AF; }
.lc-chat-day { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; color: #6B7280; font-size: .72rem; font-weight: 600; }
.lc-chat-day::before, .lc-chat-day::after { content: ""; flex: 1; height: 1px; background: rgba(15,42,68,.12); }
.lc-chat-day span { background: #fff; border: 1px solid var(--lc-border); border-radius: 999px; padding: 2px 10px; }
.lc-bubble-row { display: flex; align-items: flex-end; gap: 8px; max-width: 78%; }
.lc-bubble-row.first { margin-top: 8px; }
.lc-bubble-row.them { align-self: flex-start; }
.lc-bubble-row.me { align-self: flex-end; flex-direction: row-reverse; }
.lc-bubble-avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; background: var(--lc-navy); color: #fff; font-size: .78rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; background-size: cover; background-position: center; }
.lc-bubble { position: relative; background: #fff; border: 1px solid var(--lc-border); border-radius: 16px; padding: 8px 12px 6px; box-shadow: 0 1px 2px rgba(15,42,68,.05); min-width: 120px; }
.lc-bubble-row.them .lc-bubble { border-start-start-radius: 4px; }
.lc-bubble-row.me .lc-bubble { background: #0F2A44; color: #fff; border-color: #0F2A44; border-start-end-radius: 4px; }
.lc-bubble.high { border-inline-start: 4px solid #F59E0B; }
.lc-bubble.critical { border-inline-start: 4px solid #D92D20; }
.lc-bubble-from { font-size: .74rem; font-weight: 700; color: var(--lc-accent); margin-bottom: 2px; }
.lc-bubble-from span { font-weight: 500; color: #6B7280; margin-inline-start: 4px; }
.lc-bubble-row.me .lc-bubble-from { color: #BFE8DC; }
.lc-bubble-row.me .lc-bubble-from span { color: rgba(255,255,255,.7); }
.lc-bubble-body { white-space: pre-wrap; line-height: 1.45; font-size: .9rem; }
.lc-bubble-meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 4px; font-size: .68rem; color: #9CA3AF; }
.lc-bubble-row.me .lc-bubble-meta { color: rgba(255,255,255,.7); }
.lc-bubble-ch, .lc-bubble-ctx { border: 1px solid currentColor; border-radius: 999px; padding: 0 6px; opacity: .8; }
.lc-bubble-ctx { font-family: Consolas, monospace; }
.lc-ticks { color: #9CA3AF; }
.lc-bubble-row.me .lc-ticks { color: rgba(255,255,255,.75); }
.lc-bubble-row.me .lc-ticks.read { color: #4ADE80; }
.lc-chat-compose { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--lc-border); background: #fff; }
.lc-compose-pill { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--lc-border); background: #F8FAFC; color: var(--lc-navy); border-radius: 999px; padding: 6px 10px; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.lc-compose-pill:hover { background: #EEF2F6; }
.lc-prio-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-inline-end: 4px; }
.lc-compose-input { flex: 1; min-width: 0; height: 44px; border: 1.5px solid var(--lc-border); border-radius: 999px; padding: 0 16px; font: inherit; outline: 0; background: #F8FAFC; transition: border-color .15s, box-shadow .15s; }
.lc-compose-input:focus { background: #fff; border-color: var(--lc-navy); box-shadow: 0 0 0 4px rgba(15,42,68,.08); }
.lc-compose-send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--lc-accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; box-shadow: 0 6px 16px rgba(148,115,31,.3); transition: transform .12s, opacity .12s; }
.lc-compose-send:hover { transform: translateY(-1px); }
.lc-compose-send:disabled { opacity: .4; box-shadow: none; cursor: default; transform: none; }
@media (max-width: 900px) { .lc-chat { flex-direction: column; height: auto; } .lc-chat-side { width: 100%; max-height: 260px; border-inline-end: 0; border-bottom: 1px solid var(--lc-border); } .lc-chat-stream { min-height: 360px; } }
/* ── chat (internal messenger) ── */
.lc-nav-row { display: inline-flex; align-items: center; gap: 8px; }
.lc-nav-badge { min-width: 20px; height: 20px; padding: 0 6px; margin-inline-start: 8px; vertical-align: middle; line-height: 1; border-radius: 999px; background: var(--lc-accent); color: #fff; font-size: .7rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.lc-ch .lc-chat-side { width: 340px; }
.lc-ch-x { border: 0; background: transparent; color: #9CA3AF; cursor: pointer; display: inline-flex; padding: 4px; border-radius: 50%; }
.lc-ch-x:hover { background: #F0F3F7; color: var(--lc-navy); }
.lc-ch-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 10px; }
.lc-ch-tabs.wide { padding: 0 0 12px; }
.lc-ch-tabs button { flex: none; display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; background: transparent; color: #64748B; border-radius: 999px; padding: 4px 9px; font: inherit; font-size: .76rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .15s; }
.lc-ch-tabs button b { background: #E2E8F0; color: #334155; border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px; font-size: .68rem; display: inline-flex; align-items: center; justify-content: center; }
.lc-ch-tabs button:hover { background: #F0F3F7; color: var(--lc-navy); }
.lc-ch-tabs button.on { background: var(--lc-navy); color: #fff; border-color: var(--lc-navy); }
.lc-ch-tabs button.on b { background: var(--lc-accent); color: #fff; }
.lc-ch-av { position: relative; width: 44px; height: 44px; border-radius: 14px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--lc-navy); color: #fff; font-weight: 800; font-size: 1rem; background-size: cover; background-position: center; }
.lc-ch-av.grp { background: linear-gradient(135deg, #0F2A44, #2563EB); }
.lc-ch-av.sm { width: 36px; height: 36px; border-radius: 11px; font-size: .85rem; }
.lc-ch-av.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 1.6rem; }
.lc-ch-on { position: absolute; inset-inline-end: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: #22C55E; border: 2px solid #fff; }
.lc-ch-item { position: relative; align-items: center; }
.lc-ch-item.unread .lc-thread-title { color: #0B1F33; }
.lc-ch-item.unread .lc-thread-last { color: #1F2937; font-weight: 600; }
.lc-ch-star { font-size: 14px !important; color: #F59E0B; vertical-align: -2px; }
.lc-ch-item-menu { position: absolute; inset-inline-end: 6px; top: 6px; opacity: 0; transition: opacity .12s; }
.lc-ch-item:hover .lc-ch-item-menu, .lc-ch-item.on .lc-ch-item-menu { opacity: 1; }
.lc-ch-item:hover .lc-thread-time { visibility: hidden; }
.lc-ch-side-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 16px; color: #9CA3AF; text-align: center; font-size: .85rem; }
.lc-ch-hero { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 40px; color: #475569; max-width: 420px; }
.lc-ch-hero-ic { width: 92px; height: 92px; border-radius: 28px; background: linear-gradient(135deg, #EEF2F7, #fff); border: 1px solid var(--lc-border); display: inline-flex; align-items: center; justify-content: center; color: var(--lc-navy); box-shadow: 0 12px 30px rgba(15,42,68,.10); margin-bottom: 6px; }
.lc-ch-hero-ic .mud-icon-root { font-size: 44px; }
.lc-ch-hero h3 { margin: 0; color: #0B1F33; font-size: 1.25rem; }
.lc-ch-hero p { margin: 0 0 8px; font-size: .9rem; }
.lc-ch-head .lc-ch-av { width: 40px; height: 40px; border-radius: 12px; font-size: .9rem; }
.lc-ch-hacts { display: flex; align-items: center; gap: 2px; }
.lc-ch-online { color: #16A34A; font-weight: 600; }
.lc-ch-sbar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--lc-border); background: #FFFBEB; color: #92400E; }
.lc-ch-sbar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: #111827; }
.lc-ch-hits { display: flex; flex-direction: column; border-bottom: 1px solid var(--lc-border); max-height: 220px; overflow: auto; background: #fff; }
.lc-ch-hits button { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: start; border: 0; border-bottom: 1px solid #F1F5F9; background: transparent; padding: 8px 14px; font: inherit; font-size: .8rem; cursor: pointer; }
.lc-ch-hits button:hover { background: #F8FAFC; }
.lc-ch-hits button span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #475569; }
.lc-ch-hits button small { color: #9CA3AF; }
.lc-ch-stream { scroll-behavior: smooth; overflow-x: hidden; }
.lc-ch-older { display: flex; justify-content: center; margin-bottom: 6px; }
.lc-ch-sys { display: flex; justify-content: center; margin: 8px 0; }
.lc-ch-sys span { background: rgba(15,42,68,.08); color: #475569; border-radius: 999px; padding: 3px 12px; font-size: .74rem; font-weight: 600; }
.lc-ch-bubble { max-width: 520px; }
.lc-ch-bubble.img { padding: 4px 4px 6px; }
.lc-ch-bubble.img .lc-bubble-meta { padding: 0 8px; }
.lc-ch-bubble.img .lc-bubble-body { padding: 4px 8px 0; }
.lc-ch-bubble .lc-bubble-body { white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.lc-ch-bubble .lc-bubble-body a { color: #2563EB; text-decoration: underline; }
.lc-bubble-row.me .lc-ch-bubble .lc-bubble-body a { color: #93C5FD; }
.lc-ch-bubble mark { background: #FDE68A; border-radius: 3px; padding: 0 2px; color: #111; }
.lc-ch-fwd { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-style: italic; opacity: .75; margin-bottom: 2px; }
.lc-ch-quote { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: start; border: 0; border-inline-start: 3px solid var(--lc-accent); background: rgba(15,42,68,.06); border-radius: 8px; padding: 5px 10px; margin-bottom: 6px; font: inherit; cursor: pointer; }
.lc-bubble-row.me .lc-ch-quote { background: rgba(255,255,255,.14); border-inline-start-color: #EBD9A3; color: #fff; }
.lc-ch-quote b { font-size: .72rem; color: var(--lc-accent); }
.lc-bubble-row.me .lc-ch-quote b { color: #EBD9A3; }
.lc-ch-quote span { font-size: .76rem; opacity: .8; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.lc-ch-deleted { display: inline-flex; align-items: center; gap: 6px; font-style: italic; opacity: .7; font-size: .85rem; }
.lc-ch-img { display: block; border-radius: 12px; overflow: hidden; max-width: 360px; }
.lc-ch-img img { display: block; max-width: 100%; max-height: 320px; object-fit: cover; }
.lc-ch-file, .lc-ch-loc { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; background: rgba(15,42,68,.05); border-radius: 12px; padding: 8px 10px; min-width: 220px; }
.lc-bubble-row.me .lc-ch-file, .lc-bubble-row.me .lc-ch-loc { background: rgba(255,255,255,.12); }
.lc-ch-file-ic { width: 40px; height: 40px; border-radius: 10px; background: #fff; color: var(--lc-navy); display: inline-flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 1px 3px rgba(15,42,68,.12); }
.lc-ch-loc-map { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #DCFCE7, #BBF7D0); color: #15803D; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.lc-ch-file-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.lc-ch-file-t b { font-size: .84rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lc-ch-file-t small { font-size: .7rem; opacity: .75; }
.lc-ch-edited { font-style: italic; opacity: .75; }
.lc-ch-macts { position: absolute; top: 50%; transform: translateY(-50%); opacity: 0; transition: opacity .12s; }
.lc-bubble-row.me .lc-ch-macts { inset-inline-end: calc(100% + 6px); }
.lc-bubble-row.them .lc-ch-macts { inset-inline-start: calc(100% + 6px); }
.lc-ch-macts .mud-icon-button { width: 28px; height: 28px; padding: 0; background: #fff; color: var(--lc-navy); box-shadow: 0 2px 6px rgba(15,42,68,.18); border: 1px solid var(--lc-border); }
.lc-bubble-row:hover .lc-ch-macts { opacity: 1; }
.lc-ch-flash .lc-bubble, .lc-ch-flash span { animation: lcChFlash 1.5s ease; }
@keyframes lcChFlash { 0%, 40% { box-shadow: 0 0 0 4px rgba(245,158,11,.55); } 100% { box-shadow: none; } }
.lc-ch-compose { background: #fff; border-top: 1px solid var(--lc-border); }
.lc-ch-compose .lc-chat-compose { border-top: 0; }
.lc-ch-cbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px 0; }
.lc-ch-cbar > div { flex: 1; min-width: 0; display: flex; flex-direction: column; border-inline-start: 3px solid var(--lc-accent); padding-inline-start: 10px; }
.lc-ch-cbar b { font-size: .78rem; color: var(--lc-accent); }
.lc-ch-cbar span { font-size: .8rem; color: #475569; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lc-ch-upload .mud-input-control { margin: 0; }
.lc-ch-dialog .mud-dialog-content { padding-top: 4px; }
.lc-ch-pick-label { font-size: .72rem; font-weight: 700; color: #64748B; text-transform: uppercase; letter-spacing: .06em; margin: 6px 0; }
.lc-ch-pick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lc-ch-pick-chips button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--lc-border); background: #fff; color: #334155; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.lc-ch-pick-chips button.on { background: var(--lc-navy); color: #fff; border-color: var(--lc-navy); }
.lc-ch-people { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow: auto; }
.lc-ch-person { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid transparent; background: transparent; border-radius: 12px; padding: 8px 10px; font: inherit; text-align: start; cursor: pointer; transition: background .12s; }
.lc-ch-person:hover { background: #F0F3F7; }
.lc-ch-person.on { background: #EFF6FF; border-color: #BFDBFE; }
.lc-ch-person.static { cursor: default; }
.lc-ch-person.static:hover { background: #F8FAFC; }
.lc-ch-person-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lc-ch-person-t b { font-size: .88rem; color: #0B1F33; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lc-ch-person-t small { font-size: .72rem; color: #64748B; }
.lc-ch-go { color: #9CA3AF; }
.lc-ch-tag { background: #FEF3C7; color: #92400E; border-radius: 999px; padding: 1px 8px; font-size: .66rem; font-weight: 700; margin-inline-start: 6px; vertical-align: 1px; }
.lc-ch-info-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.lc-ch-info-head .mud-input-control { flex: 1; }
.lc-ch-readers-sum { display: flex; gap: 14px; font-size: .8rem; font-weight: 600; color: #64748B; margin-bottom: 10px; }
.lc-ch-readers-sum .ok { color: #16A34A; }
.lc-ch-readers-sum span { display: inline-flex; align-items: center; gap: 4px; }
.lc-ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.lc-ch-grid a { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #F1F5F9; }
.lc-ch-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.lc-ch-grid a:hover img { transform: scale(1.04); }
@media (max-width: 900px) { .lc-ch .lc-chat-side { width: 100%; } .lc-ch.lc-chat { flex-direction: column; height: auto; } .lc-ch .lc-chat-main { min-height: 60vh; } }

/* ── chat: photos, voice notes, calls ── */
.lc-ch-me { position: relative; border: 0; background: transparent; padding: 0; cursor: pointer; display: inline-flex; }
.lc-ch-me .lc-ch-av { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(255,255,255,.35); }
.lc-ch-me-ic { position: absolute; inset-inline-end: -4px; bottom: -4px; width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--lc-accent); color: #fff; font-size: 12px !important; box-sizing: border-box; }
.lc-ch-av-btn { border: 0; cursor: pointer; font: inherit; }
.lc-ch-av-cam { position: absolute; inset-inline-end: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--lc-navy); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(15,42,68,.25); }
.lc-ch-photo { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0; text-align: center; }
.lc-ch-photo .lc-ch-av.lg { width: 112px; height: 112px; border-radius: 32px; font-size: 2.4rem; }
.lc-ch-callbtn { color: #16A34A !important; }
.lc-ch-voice { display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 4px 2px; cursor: pointer; user-select: none; }
.lc-vo-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--lc-accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 4px 10px rgba(148,115,31,.3); }
.lc-bubble-row.me .lc-vo-btn { background: #fff; color: var(--lc-navy); box-shadow: none; }
.lc-vo-btn .pa { display: none; } .lc-ch-voice.playing .pa { display: inline-block; } .lc-ch-voice.playing .pl { display: none; }
.lc-vo-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.lc-vo-bar { position: relative; height: 6px; border-radius: 999px; background: rgba(15,42,68,.15); overflow: hidden; }
.lc-bubble-row.me .lc-vo-bar { background: rgba(255,255,255,.25); }
.lc-vo-bar i { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 0; background: var(--lc-accent); border-radius: 999px; transition: width .2s linear; }
.lc-bubble-row.me .lc-vo-bar i { background: #fff; }
.lc-vo-time { font-size: .72rem; opacity: .8; font-variant-numeric: tabular-nums; }
.lc-vo-ic { opacity: .5; font-size: 18px !important; }
.lc-compose-send.mic { background: var(--lc-navy); box-shadow: 0 6px 16px rgba(15,42,68,.3); }
.lc-ch-rec { background: #FFF1F2; }
.lc-ch-rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #D92D20; animation: lcRecPulse 1s ease-in-out infinite; }
.lc-ch-rec-time { font-weight: 800; font-variant-numeric: tabular-nums; color: #D92D20; min-width: 44px; }
@keyframes lcRecPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
.lc-ch-call { display: flex; align-items: center; gap: 10px; background: rgba(15,42,68,.05); border-radius: 12px; padding: 8px 10px; min-width: 220px; }
.lc-bubble-row.me .lc-ch-call { background: rgba(255,255,255,.12); }
.lc-ch-call-ic { width: 40px; height: 40px; border-radius: 10px; background: #DCFCE7; color: #15803D; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.lc-ch-call.missed .lc-ch-call-ic, .lc-ch-call.declined .lc-ch-call-ic, .lc-ch-call.failed .lc-ch-call-ic { background: #FEE2E2; color: #B91C1C; }
.lc-ch-callback { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #16A34A; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
/* call screen */
.lc-call { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; background: radial-gradient(120% 70% at 50% 0%, #1E3A5F 0%, #0F2A44 55%, #071423 100%); color: #fff; animation: lcCallIn .25s ease-out; }
.lc-call.rv { background: transparent; pointer-events: none; }
.lc-call.rv .lc-call-card { pointer-events: auto; background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,0) 30%, rgba(0,0,0,0) 65%, rgba(0,0,0,.7)); }
.lc-call-card { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; }
.lc-call-kind { position: absolute; top: 26px; font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: rgba(255,255,255,.75); }
.lc-call-av { position: relative; width: 128px; height: 128px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; font-weight: 800; background: linear-gradient(135deg, var(--lc-accent), #6B5214); box-shadow: 0 14px 40px rgba(0,0,0,.45); background-size: cover; background-position: center; }
.lc-call-av i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); opacity: 0; }
.lc-call.outgoing .lc-call-av i, .lc-call.incoming .lc-call-av i, .lc-call.connecting .lc-call-av i { animation: lcCallRing 2s ease-out infinite; }
.lc-call-av i + i { animation-delay: .7s !important; }
.lc-call.incoming .lc-call-av { animation: lcCallShake 1.4s ease-in-out infinite; }
.lc-call.rv .lc-call-av { display: none; }
.lc-call-name { font-size: 1.5rem; font-weight: 800; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.lc-call-status { font-size: 1rem; color: rgba(255,255,255,.85); min-height: 1.4em; font-variant-numeric: tabular-nums; }
.lc-call.rv .lc-call-name, .lc-call.rv .lc-call-status { position: absolute; top: 56px; }
.lc-call.rv .lc-call-status { top: 90px; font-size: .85rem; }
.lc-call-bar { position: absolute; bottom: 40px; display: flex; gap: 26px; align-items: flex-start; }
.lc-call.incoming .lc-call-bar { gap: 70px; }
.lc-call-b { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; color: #fff; font: inherit; font-size: .72rem; font-weight: 700; cursor: pointer; padding: 0; }
.lc-call-b span { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.16); transition: transform .15s, background .2s; }
.lc-call-b span .mud-icon-root { font-size: 28px; }
.lc-call-b:active span { transform: scale(.92); }
.lc-call-b.on span { background: #fff; color: var(--lc-navy); }
.lc-call-b.red span { background: #E53935; width: 68px; height: 68px; }
.lc-call-b.green span { background: #1E9E5A; width: 68px; height: 68px; animation: lcCallPulse 1.4s ease-in-out infinite; }
.lc-call.ended .lc-call-bar { visibility: hidden; }
#lc-call-media { display: none; }
#lc-call-media.on.rv-on { display: block; position: fixed; inset: 0; z-index: 2990; background: #000; }
#lc-call-media .rv { width: 100%; height: 100%; object-fit: cover; }
#lc-call-media .lv { display: none; position: fixed; inset-inline-start: 16px; bottom: 150px; width: 120px; height: 160px; object-fit: cover; border-radius: 16px; border: 2px solid rgba(255,255,255,.4); background: #111; transform: scaleX(-1); z-index: 3001; }
#lc-call-media.on.lv-on .lv { display: block; }
@keyframes lcCallIn { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
@keyframes lcCallRing { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.75); opacity: 0; } }
@keyframes lcCallPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(30,158,90,.55); } 50% { box-shadow: 0 0 0 14px rgba(30,158,90,0); } }
@keyframes lcCallShake { 0%, 60%, 100% { transform: rotate(0); } 66% { transform: rotate(-6deg); } 72% { transform: rotate(6deg); } 78% { transform: rotate(-4deg); } 84% { transform: rotate(3deg); } }

/* ── chat layout: the messenger's own full-window shell ── */
.lc-chl { height: 100vh; display: flex; flex-direction: column; overflow: hidden;
    background-color: #EEF2F7;
    background-image:
        radial-gradient(900px 520px at 88% -8%, rgba(15,42,68,.16), transparent 60%),
        radial-gradient(760px 520px at -6% 34%, rgba(148,115,31,.09), transparent 58%),
        radial-gradient(700px 480px at 55% 118%, rgba(37,99,235,.10), transparent 60%),
        linear-gradient(rgba(15,42,68,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,42,68,.045) 1px, transparent 1px);
    background-size: auto, auto, auto, 34px 34px, 34px 34px; }
.lc-chl-top { flex: none; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 18px; background: rgba(255,255,255,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--lc-border); }
.lc-chl-back { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--lc-navy); color: #fff; font-weight: 700; font-size: .84rem; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.lc-chl-back:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15,42,68,.25); }
.lc-chl-back .mud-icon-root { font-size: 18px; }
.lc-chl-brand { display: flex; align-items: center; gap: 10px; margin-inline-start: 6px; }
.lc-chl-brand > div { display: flex; flex-direction: column; line-height: 1.2; }
.lc-chl-brand b { font-size: 1.05rem; color: #0B1F33; }
.lc-chl-brand small { font-size: .72rem; color: #64748B; }
.lc-chl-logo { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--lc-accent), #6B5214); box-shadow: 0 8px 18px rgba(148,115,31,.28); }
.lc-chl-me { flex-direction: column; align-items: flex-start; line-height: 1.15; margin-inline: 8px 2px; }
.lc-chl-me b { font-size: .8rem; color: #0B1F33; }
.lc-chl-me small { font-size: .68rem; color: #64748B; }
.lc-chl-body { flex: 1; min-height: 0; padding: 16px; display: flex; justify-content: center; }
.lc-chl-body > .lc-chat { width: 100%; max-width: 1500px; height: 100%; min-height: 0; box-shadow: 0 24px 60px rgba(15,42,68,.14); border: 1px solid rgba(15,42,68,.08) !important; }
.lc-ch-side-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 4px; }
.lc-ch-side-head b { font-size: 1.05rem; color: #0B1F33; }
.lc-ch-side-head .lc-ch-me .lc-ch-av { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(15,42,68,.18); }
.lc-ch-new { width: 38px; height: 38px; border-radius: 12px; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; background: #E8EEF3; color: var(--lc-navy); transition: all .15s; }
.lc-ch-new:hover { background: var(--lc-navy); color: #fff; transform: translateY(-1px); }
.lc-ch-new.red { background: var(--lc-accent); color: #fff; box-shadow: 0 6px 14px rgba(148,115,31,.28); }
.lc-ch-new .mud-icon-root { font-size: 20px; }
@media (max-width: 900px) { .lc-chl { height: auto; min-height: 100vh; overflow: visible; } .lc-chl-body { padding: 8px; } .lc-chl-body > .lc-chat { height: auto; } }

/* ── chat: attach menu, upload card, map picker, camera ── */
.lc-ch-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.lc-ch-attach { position: relative; flex: none; }
.lc-ch-attach-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: #64748B; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s; }
.lc-ch-attach-btn:hover, .lc-ch-attach-btn.on { background: #E8EEF3; color: var(--lc-navy); }
.lc-ch-attach-btn.on .mud-icon-root { transform: rotate(45deg); transition: transform .2s; }
.lc-ch-attach-btn:disabled { opacity: .4; cursor: default; }
.lc-ch-attach-back { position: fixed; inset: 0; z-index: 40; }
.lc-ch-attach-menu { position: absolute; bottom: calc(100% + 12px); inset-inline-start: 0; z-index: 41; display: flex; gap: 4px; padding: 10px; background: #fff; border-radius: 18px; border: 1px solid var(--lc-border); box-shadow: 0 18px 44px rgba(15,42,68,.22); animation: lcAttachIn .18s ease-out; width: max-content; max-width: calc(100vw - 32px); }
@keyframes lcAttachIn { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.lc-ch-attach-item { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 78px; padding: 9px 4px 8px; border-radius: 12px; cursor: pointer; border: 0; background: transparent; font: inherit; font-size: .72rem; font-weight: 700; color: #334155; text-align: center; transition: background .12s; }
.lc-ch-attach-item:hover { background: #F1F5F9; }
.lc-ch-attach-ic { width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 4px 10px rgba(15,42,68,.16); }
.lc-ch-attach-ic.pic { background: linear-gradient(135deg, #1E8E54, #34C759); }
.lc-ch-attach-ic.doc { background: linear-gradient(135deg, #1D4ED8, #3B82F6); }
.lc-ch-attach-ic.cam { background: linear-gradient(135deg, #A30D26, #E0294A); }
.lc-ch-attach-ic.oth { background: linear-gradient(135deg, #6B7280, #9AA3B5); }
.lc-ch-attach-ic.loc { background: linear-gradient(135deg, #B45309, #F59E0B); }
.lc-ch-up { min-width: 260px; }
.lc-ch-upfile { display: flex; align-items: center; gap: 10px; }
.lc-ch-upicon { width: 42px; height: 42px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.18); color: #fff; }
.lc-ch-upicon.err { background: #FEE2E2; color: #B91C1C; }
.lc-ch-upthumb { position: relative; width: 46px; height: 46px; border-radius: 12px; overflow: hidden; flex: none; }
.lc-ch-upthumb img { width: 100%; height: 100%; object-fit: cover; }
.lc-ch-upthumb i { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.lc-ch-upthumb i::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: lcSpin .8s linear infinite; }
@keyframes lcSpin { to { transform: rotate(360deg); } }
.lc-ch-upmeta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lc-ch-upmeta b { font-size: .84rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 200px; }
.lc-ch-upmeta small { font-size: .7rem; opacity: .8; }
.lc-ch-uppct { font-weight: 800; font-variant-numeric: tabular-nums; font-size: .95rem; }
.lc-ch-uppct small { font-size: .65rem; opacity: .8; }
.lc-ch-upbar { position: relative; height: 5px; border-radius: 999px; background: rgba(255,255,255,.22); margin-top: 8px; overflow: hidden; }
.lc-ch-upbar span { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; background: #fff; border-radius: 999px; transition: width .2s; }
.lc-ch-upbar span.indet { width: 40%; animation: lcUpIndet 1.1s ease-in-out infinite; }
@keyframes lcUpIndet { 0% { inset-inline-start: -40%; } 100% { inset-inline-start: 100%; } }
.lc-bubble-row.me .lc-ch-up.err { background: #fff; color: #7F1D1D; border-color: #FECACA; }
.lc-ch-locmap { display: block; width: 280px; max-width: 100%; text-decoration: none; color: inherit; border-radius: 13px; overflow: hidden; background: #fff; transition: transform .15s, box-shadow .15s; }
.lc-ch-locmap:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15,42,68,.18); }
.lc-ch-locmap img { display: block; width: 100%; height: 150px; object-fit: cover; }
.lc-ch-locmap-fb { height: 110px; display: flex; align-items: center; justify-content: center; color: var(--lc-accent); background: repeating-linear-gradient(45deg, #EEF2F7, #EEF2F7 12px, #E2E8F0 12px, #E2E8F0 24px); }
.lc-ch-locmap-fb .mud-icon-root { font-size: 38px; }
.lc-ch-locmap-foot { display: flex; align-items: center; gap: 6px; padding: 7px 10px; color: #0B1F33; }
.lc-ch-locmap-foot .mud-icon-root { font-size: 16px; color: var(--lc-accent); }
.lc-ch-locmap-foot b { font-size: .78rem; white-space: nowrap; }
.lc-ch-locmap-foot small { font-size: .68rem; color: #64748B; margin-inline-start: auto; white-space: nowrap; }
.lc-ch-bubble:has(.lc-ch-locmap) { padding: 4px 4px 6px; }
.lc-ch-bubble:has(.lc-ch-locmap) .lc-bubble-meta { padding: 0 8px; }
.lc-ch-locdlg .mud-dialog-content, .lc-ch-camdlg .mud-dialog-content { padding: 0 !important; }
.lc-ch-locwrap { position: relative; }
.lc-ch-locwrap .lc-map { border-radius: 0; border: 0; }
.lc-ch-locmy { position: absolute; bottom: 16px; inset-inline-start: 14px; z-index: 500; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; background: var(--lc-navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px rgba(15,42,68,.35); transition: transform .15s; }
.lc-ch-locmy:hover { transform: scale(1.07); }
.lc-ch-lochint { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 10px 16px 2px; font-size: .78rem; font-weight: 600; color: #64748B; }
.lc-ch-lochint .lc-mono { margin-inline-start: auto; color: #0B1F33; }
.lc-ch-cam { background: #000; display: flex; justify-content: center; }
.lc-ch-cam video { width: 100%; max-height: 60vh; display: block; }

/* chat layout without a top strip: the back link is a button in the list header */
a.lc-ch-new { text-decoration: none; flex: none; }

/* ── picture picker (profile + group photo): avatar, choose / remove, hint ── */
.lc-avp { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0 12px; text-align: center; }
.lc-avp.busy { opacity: .6; pointer-events: none; }
.lc-avp-av { position: relative; width: 112px; height: 112px; border-radius: 32px; display: inline-flex; align-items: center; justify-content: center; background-color: var(--lc-navy); background-size: cover; background-position: center; color: #fff; font-weight: 800; font-size: 2.4rem; cursor: pointer; box-shadow: 0 10px 24px rgba(15,42,68,.18); transition: transform .15s, box-shadow .15s; }
.lc-avp-av:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15,42,68,.26); }
.lc-avp-av.grp { background-image: linear-gradient(135deg, #0F2A44, #2563EB); }
.lc-avp-av > .mud-icon-root { font-size: 3rem; }
.lc-avp-cam { position: absolute; inset-inline-end: -6px; bottom: -6px; width: 36px; height: 36px; border-radius: 50%; background: var(--lc-accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; border: 3px solid #fff; box-shadow: 0 4px 10px rgba(148,115,31,.3); }
.lc-avp-cam .mud-icon-root { font-size: 17px; }
.lc-avp-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lc-avp-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--lc-navy); color: #fff; font: inherit; font-weight: 700; font-size: .84rem; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.lc-avp-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15,42,68,.22); }
.lc-avp-btn .mud-icon-root { font-size: 18px; }
.lc-avp-btn.danger { background: #FEE2E2; color: #B91C1C; }
.lc-avp-btn.danger:hover { box-shadow: 0 8px 18px rgba(185,28,28,.16); }
.lc-avp-name { text-align: center; margin-bottom: 14px; }

/* ── chat text appearance: the user's font, size and weight (chat.js sets the variables) ── */
.lc-ch .lc-bubble-body, .lc-ch .lc-compose-input { font-family: var(--lc-ct-font, inherit); font-size: var(--lc-ct-size, inherit); font-weight: var(--lc-ct-weight, inherit); }
.lc-ch .lc-compose-input { color: var(--lc-ct-color, inherit); }
.lc-ch .lc-compose-input::placeholder { color: #94A3B8; font-weight: 400; }
/* coloured messages ("[c=red]…[/c]"): a strong colour on light bubbles, a soft tint on my own navy bubbles */
.lc-cc-red { color: #D32F2F; } .lc-cc-orange { color: #E8710A; } .lc-cc-gold { color: #B67807; } .lc-cc-green { color: #2E7D32; }
.lc-cc-teal { color: #00838F; } .lc-cc-blue { color: #1565C0; } .lc-cc-purple { color: #7B1FA2; } .lc-cc-gray { color: #6B7280; }
.lc-bubble-row.me .lc-cc-red { color: #FCA5A5; } .lc-bubble-row.me .lc-cc-orange { color: #FDBA74; } .lc-bubble-row.me .lc-cc-gold { color: #FCD34D; } .lc-bubble-row.me .lc-cc-green { color: #86EFAC; }
.lc-bubble-row.me .lc-cc-teal { color: #5EEAD4; } .lc-bubble-row.me .lc-cc-blue { color: #93C5FD; } .lc-bubble-row.me .lc-cc-purple { color: #D8B4FE; } .lc-bubble-row.me .lc-cc-gray { color: #CBD5E1; }
.lc-set-row { margin-bottom: 0; flex-wrap: wrap; }
.lc-set-row > div { flex: 1; min-width: 180px; }

/* chat pictures open the slide-show viewer (chat.js, lcViewer) */
button.lc-ch-img { border: 0; padding: 0; background: none; cursor: zoom-in; font: inherit; }
.lc-ch-grid > button { border: 0; padding: 0; cursor: zoom-in; display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #F1F5F9; }
.lc-ch-grid > button:hover img { transform: scale(1.04); }


/* ══ chat on phones ══ two separate screens: the list of conversations fills the page; a conversation opens as a
   page of its own with a back button (Chat.razor puts lc-ch-list / lc-ch-open on the root). */
.lc-ch-back { display: none; flex: none; }
@media (max-width: 900px) {
    .lc-chl { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
    .lc-chl-body { padding: 0; }
    .lc-chl-body > .lc-chat { height: 100%; min-height: 0; max-width: none; border: 0 !important; border-radius: 0 !important; box-shadow: none; }
    .lc-ch.lc-chat { flex-direction: column; height: 100%; }
    .lc-ch .lc-chat-side { width: 100%; max-height: none; flex: 1 1 auto; min-height: 0; border: 0; }
    .lc-ch .lc-chat-main { flex: 1 1 auto; min-height: 0; }
    .lc-ch.lc-ch-list .lc-chat-main { display: none; }
    .lc-ch.lc-ch-open .lc-chat-side { display: none; }
    .lc-ch .lc-chat-stream { min-height: 0; padding: 10px 10px; }
    .lc-ch-back { display: inline-flex; width: 34px; height: 34px; border-radius: 10px; }
    .lc-ch .lc-chat-head { gap: 8px; padding: 8px 10px; }
    .lc-ch-head .lc-ch-av { width: 36px; height: 36px; }
    .lc-ch-hacts .mud-icon-button { padding: 6px; }
}
@media (max-width: 900px) {
    /* the conversation's header on a phone: the name on one line (cut with dots), the action icons closer together */
    .lc-ch .lc-chat-head-body b, .lc-ch .lc-chat-head-body .lc-muted { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .lc-ch-hacts { gap: 0; flex: none; }
    .lc-ch-hacts .mud-icon-button { padding: 4px; }
    .lc-ch-hacts .mud-icon-root { font-size: 1.3rem; }
}

/* ══ chat: a modern backdrop and a little motion ══ */
.lc-ch .lc-ch-stream {
    background-color: #EFF4F7;
    background-image:
        radial-gradient(820px 460px at 100% 0%, rgba(148,115,31,.13), transparent 62%),
        radial-gradient(720px 460px at 0% 100%, rgba(37,99,235,.10), transparent 62%),
        radial-gradient(520px 360px at 40% 45%, rgba(255,255,255,.55), transparent 70%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='132' viewBox='0 0 132 132'%3E%3Cg fill='none' stroke='%230F2A44' stroke-opacity='.065' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 20h16a5 5 0 0 1 5 5v7a5 5 0 0 1-5 5h-9l-6 5v-5h-1a5 5 0 0 1-5-5v-7a5 5 0 0 1 5-5z'/%3E%3Ccircle cx='96' cy='30' r='8'/%3E%3Cpath d='M92 30l3 3 6-6'/%3E%3Cpath d='M84 92h20M94 82v20'/%3E%3Cpath d='M22 96c5-7 11-7 16 0s11 7 16 0'/%3E%3C/g%3E%3Cg fill='%230F8A6C' fill-opacity='.14'%3E%3Ccircle cx='66' cy='64' r='2.2'/%3E%3Ccircle cx='120' cy='118' r='2'/%3E%3Ccircle cx='8' cy='70' r='1.8'/%3E%3Ccircle cx='62' cy='12' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
    background-size: auto, auto, auto, 132px 132px;
    background-attachment: local, local, local, local;
}
/* my messages: a deep gradient instead of the flat navy; theirs: white glass with a soft shadow */
.lc-ch .lc-bubble-row.me .lc-ch-bubble { background: linear-gradient(135deg, #0A2540 0%, #12365A 62%, #2B4A6E 130%); border-color: transparent; box-shadow: 0 6px 16px rgba(15,42,68,.20); }
.lc-ch .lc-bubble-row.them .lc-ch-bubble { background: rgba(255,255,255,.94); border-color: rgba(15,42,68,.07); box-shadow: 0 4px 14px rgba(15,42,68,.08); }
.lc-ch .lc-chat-day span { background: rgba(255,255,255,.78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-color: rgba(15,42,68,.08); box-shadow: 0 2px 8px rgba(15,42,68,.06); }
.lc-ch .lc-chat-day::before, .lc-ch .lc-chat-day::after { background: linear-gradient(90deg, transparent, rgba(15,42,68,.14), transparent); }
.lc-ch .lc-ch-sys span { background: rgba(255,255,255,.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 1px 4px rgba(15,42,68,.06); }
.lc-ch .lc-chat-head { background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 1px 0 rgba(15,42,68,.05), 0 6px 18px rgba(15,42,68,.04); z-index: 1; }
.lc-ch .lc-chat-compose { background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 -6px 18px rgba(15,42,68,.05); }
.lc-ch .lc-chat-side { background: linear-gradient(180deg, #FBFCFD, #F3F6F9); }
.lc-ch .lc-ch-hero-ic { background: linear-gradient(135deg, #E6F4EF, #fff 60%, #E8EEF8); box-shadow: 0 18px 40px rgba(15,42,68,.12); }

@media (prefers-reduced-motion: no-preference) {
    @keyframes lcChMsgMe { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
    @keyframes lcChMsgThem { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
    @keyframes lcChFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
    @keyframes lcChFade { from { opacity: 0; } to { opacity: 1; } }
    @keyframes lcChPop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.18); opacity: 1; } 100% { transform: scale(1); } }
    @keyframes lcChFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
    @keyframes lcChOnline { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 100% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } }
    @keyframes lcChPageIn { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
    @keyframes lcChPageInRtl { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }

    /* a message arrives: it rises into place from its own side */
    .lc-ch .lc-ch-stream .lc-bubble-row { animation: lcChMsgThem .26s cubic-bezier(.2,.8,.2,1) both; transform-origin: 0 100%; }
    .lc-ch .lc-ch-stream .lc-bubble-row.me { animation-name: lcChMsgMe; transform-origin: 100% 100%; }
    [dir="rtl"] .lc-ch .lc-ch-stream .lc-bubble-row { transform-origin: 100% 100%; }
    [dir="rtl"] .lc-ch .lc-ch-stream .lc-bubble-row.me { transform-origin: 0 100%; }
    .lc-ch .lc-chat-day, .lc-ch .lc-ch-sys { animation: lcChFade .35s ease both; }
    /* the list: conversations slide in one after another; a row lifts a little under the finger or the mouse */
    .lc-ch .lc-ch-item { animation: lcChFadeUp .32s cubic-bezier(.2,.8,.2,1) both; transition: background .15s, transform .15s, box-shadow .15s; }
    .lc-ch .lc-ch-item:nth-child(2) { animation-delay: .04s; } .lc-ch .lc-ch-item:nth-child(3) { animation-delay: .08s; }
    .lc-ch .lc-ch-item:nth-child(4) { animation-delay: .12s; } .lc-ch .lc-ch-item:nth-child(5) { animation-delay: .16s; }
    .lc-ch .lc-ch-item:nth-child(6) { animation-delay: .20s; } .lc-ch .lc-ch-item:nth-child(n+7) { animation-delay: .24s; }
    .lc-ch .lc-ch-item:hover { transform: translateY(-1px); }
    .lc-ch .lc-ch-item:active { transform: scale(.985); }
    .lc-ch .lc-thread-badge { animation: lcChPop .34s cubic-bezier(.2,.9,.3,1.3) both; }
    .lc-ch .lc-ch-on { animation: lcChOnline 1.8s ease-out infinite; }
    /* the empty state breathes; the header and the box to type in settle in when a conversation opens */
    .lc-ch .lc-ch-hero-ic { animation: lcChFloat 3.6s ease-in-out infinite; }
    .lc-ch .lc-ch-hero > * { animation: lcChFadeUp .4s ease both; }
    .lc-ch .lc-ch-hero > *:nth-child(2) { animation-delay: .06s; } .lc-ch .lc-ch-hero > *:nth-child(3) { animation-delay: .12s; } .lc-ch .lc-ch-hero > *:nth-child(4) { animation-delay: .18s; }
    .lc-ch .lc-chat-head, .lc-ch .lc-chat-compose { animation: lcChFade .3s ease both; }
    .lc-ch .lc-chat-compose button, .lc-ch .lc-ch-new { transition: transform .15s, box-shadow .15s, background .15s; }
    .lc-ch .lc-chat-compose button:active, .lc-ch .lc-ch-new:active { transform: scale(.9); }
    .lc-ch .lc-ch-tabs button { transition: background .18s, color .18s, transform .15s; }
    .lc-ch .lc-ch-tabs button:active { transform: scale(.95); }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 900px) {
    /* phones: a conversation opens like a page sliding in; going back, the list fades in */
    .lc-ch.lc-ch-open .lc-chat-main { animation: lcChPageIn .26s cubic-bezier(.2,.8,.2,1) both; }
    [dir="rtl"] .lc-ch.lc-ch-open .lc-chat-main { animation-name: lcChPageInRtl; }
    .lc-ch.lc-ch-list .lc-chat-side { animation: lcChFade .22s ease both; }
}


/* ══ chat: the screen before a conversation is chosen, and the chat list on phones ══ a pale patterned backdrop and a dark navy one were both turned
   down; asked, he chose "light, clean gradient": white fading to soft mint and blue, no pattern, no dark colours.
   Two very faint colour clouds drift behind; the invitation sits on a white glass card with a green mark. */
.lc-ch.lc-ch-list .lc-chat-main {
    position: relative; overflow: hidden; isolation: isolate;
    background: linear-gradient(155deg, #FFFFFF 0%, #F3FBF8 42%, #EAF4FF 100%);
}
.lc-ch.lc-ch-list .lc-chat-main::before, .lc-ch.lc-ch-list .lc-chat-main::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); pointer-events: none; }
.lc-ch.lc-ch-list .lc-chat-main::before { width: 460px; height: 460px; top: -150px; inset-inline-end: -120px; background: radial-gradient(circle, rgba(212,178,92,.30), rgba(212,178,92,0) 70%); }
.lc-ch.lc-ch-list .lc-chat-main::after { width: 500px; height: 500px; bottom: -190px; inset-inline-start: -140px; background: radial-gradient(circle, rgba(96,165,250,.28), rgba(96,165,250,0) 70%); }
.lc-ch .lc-ch-hero { position: relative; max-width: 460px; gap: 12px; padding: 46px 46px 40px; border-radius: 30px; color: #51607A;
    background: rgba(255,255,255,.78); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.95); box-shadow: 0 24px 60px rgba(15,42,68,.10), 0 2px 6px rgba(15,42,68,.04); }
.lc-ch .lc-ch-hero-ic { width: 92px; height: 92px; border-radius: 28px; border: 0; color: #fff;
    background: linear-gradient(140deg, #D4B25C 0%, #B08A2E 55%, #94731F 100%);
    box-shadow: 0 18px 36px rgba(148,115,31,.28), 0 0 0 10px rgba(148,115,31,.08), 0 0 0 22px rgba(148,115,31,.04), inset 0 1px 0 rgba(255,255,255,.45); margin-bottom: 8px; }
.lc-ch .lc-ch-hero-ic .mud-icon-root { font-size: 44px; }
.lc-ch .lc-ch-hero h3 { font-size: 1.45rem; font-weight: 800; color: #0B1F33; }
.lc-ch .lc-ch-hero p { font-size: .95rem; line-height: 1.7; margin-bottom: 12px; color: #5B6B82; }
.lc-ch .lc-ch-hero .mud-button-root { border-radius: 999px; padding: 8px 20px; font-weight: 700; }
.lc-ch .lc-ch-hero .mud-button-outlined { background: #fff; border-color: #D5DEE8; color: #0B1F33; }
.lc-ch .lc-ch-hero .mud-button-filled { box-shadow: 0 10px 22px rgba(148,115,31,.28); }
@media (prefers-reduced-motion: no-preference) {
    @keyframes lcChCloudA { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-46px, 40px) scale(1.14); } }
    @keyframes lcChCloudB { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(50px, -34px) scale(1.1); } }
    @keyframes lcChHeroIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
    .lc-ch.lc-ch-list .lc-chat-main::before { animation: lcChCloudA 14s ease-in-out infinite; }
    .lc-ch.lc-ch-list .lc-chat-main::after { animation: lcChCloudB 17s ease-in-out infinite; }
    .lc-ch .lc-ch-hero { animation: lcChHeroIn .5s cubic-bezier(.2,.8,.2,1) backwards; }
    .lc-ch .lc-ch-hero .mud-button-root { transition: transform .18s, box-shadow .18s, background .18s; }
    .lc-ch .lc-ch-hero .mud-button-root:hover { transform: translateY(-2px); }
    .lc-ch .lc-ch-hero .lc-ch-hero-ic { animation: lcChFadeUp .4s ease backwards, lcChFloat 3.6s ease-in-out .4s infinite; }
}
/* phones (and the phone app): the list is the whole screen, on the same light gradient; each conversation is a
   white card, the filters slide in one row */
@media (max-width: 900px) {
    .lc-ch.lc-ch-list .lc-chat-side { background: linear-gradient(165deg, #FFFFFF 0%, #F1FBF7 40%, #E9F3FF 100%); }
    .lc-ch.lc-ch-list .lc-ch-side-head { padding: 14px 14px 8px; }
    .lc-ch.lc-ch-list .lc-ch-side-head b { font-size: 1.15rem; }
    .lc-ch.lc-ch-list .lc-ch-side-head .lc-ch-new { background: #fff; box-shadow: 0 2px 8px rgba(15,42,68,.08); }
    .lc-ch.lc-ch-list .lc-ch-side-head .lc-ch-new.red { background: linear-gradient(135deg, #D4B25C, #94731F); color: #fff; box-shadow: 0 8px 18px rgba(148,115,31,.28); }
    .lc-ch.lc-ch-list .lc-chat-search { margin: 4px 12px 10px; background: rgba(255,255,255,.9); border: 1px solid #E1E8F0; border-radius: 14px; box-shadow: 0 2px 10px rgba(15,42,68,.05); }
    .lc-ch.lc-ch-list .lc-ch-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 0 12px 12px; gap: 6px; }
    .lc-ch.lc-ch-list .lc-ch-tabs::-webkit-scrollbar { display: none; }
    .lc-ch.lc-ch-list .lc-ch-tabs button { background: rgba(255,255,255,.85); border-color: #E1E8F0; padding: 6px 12px; font-size: .76rem; }
    .lc-ch.lc-ch-list .lc-ch-tabs button.on { background: var(--lc-navy); color: #fff; border-color: var(--lc-navy); }
    .lc-ch.lc-ch-list .lc-chat-threads { padding: 4px 10px 16px; }
    .lc-ch.lc-ch-list .lc-ch-item { background: #fff; margin-bottom: 8px; border-radius: 16px; box-shadow: 0 2px 10px rgba(15,42,68,.06); }
    .lc-ch.lc-ch-list .lc-ch-item.unread { box-shadow: 0 4px 14px rgba(148,115,31,.16); }
}

/* ══ iPhone notch / status bar / home bar ══. Wherever the page reaches under the device's own bars (viewport-fit=cover: landscape, a page opened
   from the home screen, the app's web view) every header, window and floating button keeps clear of them. On a
   device without such bars each inset is 0 and nothing changes. */
@supports (padding: env(safe-area-inset-top)) {
    .lc-appbar { padding-top: env(safe-area-inset-top); padding-inline-start: env(safe-area-inset-left); padding-inline-end: env(safe-area-inset-right); }
    .mud-layout > .mud-main-content { padding-top: calc(var(--mud-appbar-height, 64px) + env(safe-area-inset-top)); padding-bottom: env(safe-area-inset-bottom); }
    .mud-drawer .mud-drawer-content { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
    .mud-main-content > .mud-container { padding-inline-start: max(16px, env(safe-area-inset-left)); padding-inline-end: max(16px, env(safe-area-inset-right)); }
    /* the messenger has no top bar of its own: its two headers and the box to type in carry the insets */
    .lc-chl { padding-inline-start: env(safe-area-inset-left); padding-inline-end: env(safe-area-inset-right); }
    .lc-ch .lc-ch-side-head { padding-top: calc(14px + env(safe-area-inset-top)); }
    .lc-ch .lc-chat-head { padding-top: calc(10px + env(safe-area-inset-top)); }
    .lc-ch .lc-chat-compose { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
    .lc-ch .lc-chat-threads { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
    /* windows, the floating send button, the error card, the start-up and sign-in screens */
    .mud-dialog-container { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
    .lc-send-fab { bottom: calc(24px + env(safe-area-inset-bottom)); }
    #blazor-error-ui { padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important; }
    .mud-snackbar-location-bottom-center { bottom: calc(24px + env(safe-area-inset-bottom)); }
}
@supports (padding: env(safe-area-inset-top)) {
    @media (max-width: 700px) {
        .mud-layout > .mud-main-content { padding-top: calc(50px + env(safe-area-inset-top)) !important; }
        .mud-main-content > .mud-container { padding-inline-start: max(10px, env(safe-area-inset-left)) !important; padding-inline-end: max(10px, env(safe-area-inset-right)) !important; }
        .lc-send-fab { bottom: calc(16px + env(safe-area-inset-bottom)); }
        #blazor-error-ui { padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important; }
    }
    @media (max-width: 900px) {
        .lc-ch .lc-chat-head { padding-top: calc(8px + env(safe-area-inset-top)); }
    }
}

/* ── the tile strip's slide buttons are always in view (they used to appear only under the mouse, so on a touch
   screen and at first glance there were none:). While there is more to slide
   to, both show: the one with nowhere left to go is dimmed. When every tile fits, neither shows. ── */
.lc-strip-arrow { opacity: 1; z-index: 3; width: 34px; height: 34px; border-color: var(--lc-accent); color: var(--lc-accent); background: #fff; box-shadow: 0 6px 16px rgba(15,42,68,.18); }
.lc-strip-arrow:hover { background: var(--lc-accent); color: #fff; }
.lc-strip-arrow.prev { inset-inline-start: -4px; }
.lc-strip-arrow.next { inset-inline-end: -4px; }
.lc-strip-wrap:has(.lc-strip-arrow:not([disabled])) .lc-strip-arrow[disabled] { opacity: .35 !important; box-shadow: none; }

/* ── Documents: the word processor in its frame, filling the window like the messenger (Documents.razor) ── */
.lc-chl-body > .lc-writer { flex: 1; width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 24px 60px rgba(15,42,68,.14); }
.lc-chl:has(> .lc-chl-body > .lc-writer) > .lc-chl-body { padding: 10px; }
@media (max-width: 900px) {
    .lc-chl-body > .lc-writer { border-radius: 0; box-shadow: none; }
    .lc-chl:has(> .lc-chl-body > .lc-writer) > .lc-chl-body { padding: 0; }
    .lc-chl:has(> .lc-chl-body > .lc-writer) { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); background: #185abd; }
}
/* a letter in the word processor, under the page's own header (WriterEditor.razor) */
.lc-writer-inline { display: block; width: 100%; height: calc(100vh - 205px); min-height: 520px; border: 1px solid var(--lc-border); border-radius: 16px; background: #fff; box-shadow: 0 10px 30px rgba(15,42,68,.08); }
@media (max-width: 700px) { .lc-writer-inline { height: calc(100vh - 170px); height: calc(100dvh - 170px); min-height: 420px; border-radius: 12px; } }

/* ── the map of "share location" (ChatMapPicker, chat-ui.js) ── */
.lc-mappick { display: flex; flex-direction: column; gap: 8px; }
.lc-map { width: 100%; border-radius: 14px; overflow: hidden; border: 1px solid var(--lc-border); background: #EEF2F7; z-index: 0; }
.lc-map-pin { background: transparent; border: 0; }
/* the same pin on a Google map: the marker is this element itself, standing on its tip */
.lc-map-pin.g { width: 30px; height: 40px; cursor: grab; }
.lc-map-pin i { display: block; width: 26px; height: 26px; margin: 2px auto 0; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
    background: #D92D20; border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.35); }
.lc-mappick-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lc-gps { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: #F1F5F9; font-size: .84rem; flex-wrap: wrap; }
.lc-gps.bad { background: #FEF3F2; color: #B42318; }
.lc-gps-text { display: flex; flex-direction: column; flex: 1; min-width: 160px; }
.lc-gps-text small { color: #6B7280; }
