/* Visitors (#agent/visitors). The lv- pieces on top of the Money design
   system; colours come from its --m-* tokens so light, dark and the agent's
   brand colour all carry over. The chat page is a full-height three pane
   layout; on a phone it is one pane at a time, because answering a chat from
   the phone is the main use. */

.lv-gap { margin-top: 12px; }
.lv-gap0 { margin-bottom: 12px; }
.lv-pad { padding: 10px 2px; }
.lv-grow { flex: 1 1 auto; }
.lv-hint { font-size: 12px; line-height: 1.45; color: var(--m-muted); margin-top: 6px; }
.lv-link { color: var(--m-accent) !important; text-decoration: underline !important; }
.lv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lv-three { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; margin: 8px 0; }
.lv-three label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--m-muted); }
.lv-inline { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.lv-navcount:empty { display: none; }

/* fields: inputs outside .m-form are unstyled, so they are styled here */
.lv-field { margin-bottom: 12px; }
.lv-app input[type=text], .lv-app input[type=email], .lv-app input[type=number], .lv-app input[type=search], .lv-app select, .lv-app textarea {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 13.5px; line-height: 1.45; color: var(--m-ink); background: var(--m-surface);
  border: 1px solid var(--m-line); border-radius: 8px; padding: 8px 11px; min-height: 36px; }
.lv-app textarea { resize: vertical; }
.lv-app input:focus, .lv-app select:focus, .lv-app textarea:focus { outline: none; border-color: var(--m-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--m-accent) 18%, transparent); }
.lv-app input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--m-accent); }

/* the Available switch at the top of the rail */
.lv-status { display: flex; align-items: center; gap: 10px; padding: 10px; margin: 2px 0 12px; border: 1px solid var(--m-line); border-radius: 10px; background: var(--m-surface); }
.lv-status-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lv-status-t b { font-size: 13px; font-weight: 600; color: var(--m-ink); }
.lv-status-t small { font-size: 11px; color: var(--m-muted); line-height: 1.3; }
.lv-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--m-faint); flex-shrink: 0; }
.lv-dot.on { background: var(--m-pos); box-shadow: 0 0 0 3px var(--m-pos-soft); }
.lv-dot.idle { background: var(--m-warn); }
.lv-status .m-toggle { width: 38px; height: 22px; }
.lv-status .m-toggle::after { width: 18px; height: 18px; }
.lv-status .m-toggle.on::after { left: 18px; }
.lv-foot .tk-foot-note { font-size: 11.5px; line-height: 1.45; color: var(--m-muted); padding: 10px 10px 0; }

.lv-banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border: 1px solid #E8D9BE; background: #FBF5EA; color: #6B4C17; border-radius: 10px; font-size: 13.5px; line-height: 1.5; }
.lv-banner .i { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; }
.lv-banner a { text-decoration: underline !important; }
[data-theme="dark"] .lv-banner { border-color: #5a4a2a; background: #2e2716; color: #E9D3A4; }

/* figures: one line between two hairlines */
.lv-figs { display: flex; flex-wrap: wrap; border-top: 1px solid var(--m-line); border-bottom: 1px solid var(--m-line); }
.lv-fig { flex: 1 1 120px; padding: 16px 18px 14px 0; }
.lv-fig .v { font-size: 26px; line-height: 1.15; font-weight: 600; color: var(--m-ink); font-variant-numeric: tabular-nums; }
.lv-fig .v.neg { color: var(--m-neg); }
.lv-fig .l { font-size: 12.5px; color: var(--m-muted); margin-top: 3px; }
[data-lv-live] { display: flex; flex-direction: column; gap: 22px; }

/* avatar + score */
.lv-av { position: relative; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--m-surface-2); color: var(--m-muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.lv-av.known { background: var(--m-accent-soft); color: var(--m-accent); }
.lv-av i { position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--m-pos); border: 2px solid var(--m-surface); }
.lv-score { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 24px; padding: 0 8px; margin-right: 6px; border-radius: 6px; background: var(--m-surface-2); color: var(--m-muted); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lv-score.warm { background: var(--m-warn-soft); color: var(--m-warn); }
.lv-score.hot { background: var(--m-neg-soft); color: var(--m-neg); }

/* live now */
.lv-livelist { display: flex; flex-direction: column; }
.lv-liverow { display: grid; grid-template-columns: 36px minmax(0, 1fr) 110px 170px 200px 112px; gap: 14px; align-items: center; width: 100%; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--m-line-soft); background: none; color: var(--m-ink); font: inherit; text-align: left; cursor: pointer; }
.lv-liverow:last-child { border-bottom: 0; }
.lv-liverow:hover { background: var(--m-surface-2); }
.lv-liverow b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-liverow small { display: block; font-size: 12px; color: var(--m-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-liverow .lv-path { color: var(--m-faint); font-size: 11.5px; }
.lv-lr-main, .lv-lr-col { min-width: 0; }
.lv-lr-score { display: flex; align-items: center; justify-content: flex-end; white-space: nowrap; }

/* tables, toolbars */
.lv-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lv-toolbar select { width: auto; min-width: 170px; height: 34px; min-height: 34px; padding: 0 10px; font-size: 13px; }
.lv-app .lv-search { width: auto; flex: 1 1 220px; max-width: 320px; margin-left: auto; height: 34px; min-height: 34px; font-size: 13px; }
.lv-rowlink { cursor: pointer; }
.lv-table .m-cellmain .lv-av { flex-basis: 32px; width: 32px; height: 32px; }
.lv-pager { display: flex; gap: 8px; justify-content: flex-end; }
.lv-crumb { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--m-muted) !important; margin-bottom: -6px; }
.lv-crumb:hover { color: var(--m-ink) !important; }

.lv-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 28px; align-items: start; }
.lv-cols.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.lv-cols > div { display: flex; flex-direction: column; gap: 26px; min-width: 0; }

/* one visitor */
.lv-person-head { align-items: center; }
.lv-ph { display: flex; align-items: center; gap: 14px; min-width: 0; }
.lv-ph .lv-av { flex-basis: 48px; width: 48px; height: 48px; font-size: 15px; }
.lv-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 16px; margin: 0; font-size: 13px; }
.lv-facts dt { color: var(--m-muted); }
.lv-facts dd { margin: 0; color: var(--m-ink); overflow-wrap: anywhere; }
.lv-why { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--m-line-soft); font-size: 13px; }
.lv-why b { font-variant-numeric: tabular-nums; color: var(--m-pos); }
.lv-home { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--m-line-soft); color: var(--m-ink); }
.lv-home:last-child { border-bottom: 0; }
.lv-home svg.i { margin-top: 2px; color: var(--m-faint); }
.lv-home b { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.lv-home small { display: block; font-size: 12px; color: var(--m-muted); }
.lv-visit { padding: 4px 0 14px; border-bottom: 1px solid var(--m-line); margin-bottom: 12px; }
.lv-visit:last-child { border-bottom: 0; margin-bottom: 0; }
.lv-visit-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 8px; }
.lv-visit-head .m-faint { font-size: 12px; }
.lv-ev { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; }
.lv-ev b { display: block; font-size: 13px; font-weight: 500; color: var(--m-ink); overflow-wrap: anywhere; }
.lv-ev small { display: block; font-size: 11.5px; color: var(--m-faint); overflow-wrap: anywhere; }
.lv-ev-dot { flex: 0 0 8px; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--m-line); }
.lv-ev-dot.listing { background: #B8813A; }
.lv-ev-dot.search { background: #4f7cac; }
.lv-ev-dot.save, .lv-ev-dot.form_submit { background: var(--m-pos); }
.lv-ev-dot.form_start { background: var(--m-warn); }

/* alerts */
.lv-alerts { display: flex; flex-direction: column; }
.lv-alert { display: flex; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--m-line-soft); }
.lv-alert:last-child { border-bottom: 0; }
.lv-alert:hover { background: var(--m-surface-2); }
.lv-alert-ic { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--m-surface-2); color: var(--m-muted); }
.lv-alert.unread .lv-alert-ic { background: var(--m-accent-soft); color: var(--m-accent); }
.lv-alert.unread b { font-weight: 700; }

/* reports */
.lv-bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding-top: 6px; }
.lv-bar { position: relative; flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; }
.lv-bar i { display: block; width: 100%; background: var(--brand, #1D2733); border-radius: 2px 2px 0 0; opacity: .88; }
.lv-bar u { position: absolute; left: 22%; right: 22%; bottom: 0; background: #B8813A; border-radius: 2px 2px 0 0; text-decoration: none; }
[data-theme="dark"] .lv-bar i { background: var(--m-accent); }
.lv-barsfoot { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--m-muted); padding-top: 6px; border-top: 1px solid var(--m-line); }
.lv-rank { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) 44px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.lv-rank .k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-rank .b { height: 6px; border-radius: 3px; background: var(--m-surface-2); overflow: hidden; }
.lv-rank .b i { display: block; height: 100%; background: var(--brand, #1D2733); border-radius: 3px; }
[data-theme="dark"] .lv-rank .b i { background: var(--m-accent); }
.lv-rank .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--m-muted); }

/* settings */
.lv-switch { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--m-line-soft); }
.lv-switch b { display: block; font-size: 13.5px; font-weight: 600; }
.lv-switch small { display: block; font-size: 12.5px; color: var(--m-muted); line-height: 1.45; margin-top: 2px; max-width: 520px; }
.lv-switch .m-toggle { width: 38px; height: 22px; }
.lv-switch .m-toggle::after { width: 18px; height: 18px; }
.lv-switch .m-toggle.on::after { left: 18px; }
.lv-color { display: flex; align-items: center; gap: 10px; }
.lv-color input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--m-line); border-radius: 8px; background: var(--m-surface); cursor: pointer; }
.lv-color code { font-size: 12.5px; color: var(--m-muted); }
.lv-preview { position: relative; margin-top: 8px; padding: 18px 18px 70px; border-radius: 12px; background: var(--m-surface-2); min-height: 250px; }
.lv-pv-panel { width: min(280px, 100%); margin-left: auto; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid #e1e5ea; box-shadow: 0 8px 28px rgba(15, 25, 35, .14); color: #14202b; }
.lv-pv-head { padding: 12px 14px; color: #fff; }
.lv-pv-head b { display: block; font-size: 14px; } .lv-pv-head small { font-size: 11.5px; opacity: .85; }
.lv-pv-body { padding: 14px; background: #f6f7f9; min-height: 70px; }
.lv-pv-body span { display: inline-block; max-width: 90%; padding: 8px 11px; border-radius: 12px 12px 12px 4px; background: #fff; border: 1px solid #e4e7eb; font-size: 12.5px; line-height: 1.4; }
.lv-pv-note { font-size: 10.5px; color: #8a949e; text-align: center; padding: 8px; }
.lv-pv-bubble { position: absolute; right: 18px; bottom: 14px; width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 6px 18px rgba(15, 25, 35, .25); }
.lv-pv-bubble svg.i { width: 20px; height: 20px; }
.lv-hours { display: flex; flex-direction: column; margin-top: 8px; }
.lv-hours.off { opacity: .45; pointer-events: none; }
.lv-hour { display: grid; grid-template-columns: 150px 130px 20px 130px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--m-line-soft); font-size: 13px; }
.lv-hour .m-check { font-size: 13.5px; color: var(--m-ink); }
.lv-cannedrow { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--m-line-soft); }
.lv-slash { display: flex; align-items: center; gap: 4px; }
.lv-slash span { color: var(--m-faint); font-weight: 600; }
.lv-trigger { padding: 12px 0; border-bottom: 1px solid var(--m-line-soft); }
.lv-trigger-top { display: flex; gap: 10px; align-items: center; }
.lv-alerttable td, .lv-alerttable th { padding-left: 4px !important; }
.lv-pushrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lv-devices { margin-top: 14px; }
.lv-device { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--m-line-soft); }
.lv-device span { flex: 1 1 auto; min-width: 0; }
.lv-device b { display: block; font-size: 13px; } .lv-device small { display: block; font-size: 12px; color: var(--m-muted); }
.lv-code { margin: 0 0 10px; padding: 12px 14px; border-radius: 8px; background: var(--m-surface-2); color: var(--m-ink); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-all; }

/* ---- chats: inbox | conversation | visitor ---- */
/* clean.css pads every .m-main and loads after this file, so the chat page
   says it with one more class than clean.css does. */
.money-app.lv-app.lv-bare > .m-main.lv-main,
body.clean-on .money-app.lv-app.lv-bare:not(.tools-app):not(.sg-app) > .m-main.lv-main { padding: 0; gap: 0; max-width: none; }
.lv-chatgrid { display: grid; grid-template-columns: 310px minmax(0, 1fr) 300px; height: calc(100vh - 56px); min-height: 420px; background: var(--m-surface); }
.lv-inbox { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--m-line); }
.lv-inbox-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--m-line); }
.lv-inbox-head .m-seg { display: flex; }
.lv-inbox-head .m-seg .m-btn { flex: 1 1 0; justify-content: center; }
.lv-inbox-list { flex: 1 1 auto; overflow-y: auto; }
.lv-inbox-empty { padding: 28px 20px; font-size: 13px; line-height: 1.5; color: var(--m-muted); text-align: center; }
.lv-inrow { display: flex; gap: 11px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--m-line-soft); color: var(--m-ink); }
.lv-inrow:hover { background: var(--m-surface-2); }
.lv-inrow.on { background: var(--m-accent-soft); }
.lv-in-main { flex: 1 1 auto; min-width: 0; }
.lv-in-main b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-in-main small { display: block; font-size: 12.5px; color: var(--m-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-inrow.unread .lv-in-main b, .lv-inrow.unread .lv-in-main small { font-weight: 700; color: var(--m-ink); }
.lv-in-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.lv-in-side small { font-size: 11px; color: var(--m-faint); white-space: nowrap; }
.lv-unread { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--m-neg); color: #fff; font-size: 11px; font-weight: 700; font-style: normal; display: inline-flex; align-items: center; justify-content: center; }

.lv-convo { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--m-bg); }
.lv-convo-empty { align-items: center; justify-content: center; }
.lv-convo-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; min-height: 58px; border-bottom: 1px solid var(--m-line); background: var(--m-surface); }
.lv-convo-who { flex: 1 1 auto; min-width: 0; }
.lv-convo-who b { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-convo-who small { display: block; font-size: 12px; color: var(--m-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-convo-acts { display: flex; gap: 6px; flex-shrink: 0; }
.lv-back, .lv-details-btn, .lv-ctx-close { display: none !important; }
.lv-msgs { flex: 1 1 auto; overflow-y: auto; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.lv-stamp { align-self: center; font-size: 11.5px; color: var(--m-faint); margin: 8px 0 4px; }
.lv-msg { display: flex; flex-direction: column; max-width: min(78%, 560px); }
.lv-msg small { font-size: 10.5px; color: var(--m-faint); margin: 2px 4px 4px; }
.lv-msg.them { align-self: flex-start; }
.lv-msg.me { align-self: flex-end; align-items: flex-end; }
.lv-msg.sys { align-self: center; max-width: 92%; }
.lv-bubble { padding: 9px 13px; border-radius: 15px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.lv-bubble a { text-decoration: underline !important; }
.lv-msg.them .lv-bubble { background: var(--m-surface); border: 1px solid var(--m-line); border-bottom-left-radius: 5px; color: var(--m-ink); }
.lv-msg.me .lv-bubble { background: var(--brand, #1D2733); color: #fff; border-bottom-right-radius: 5px; }
[data-theme="dark"] .lv-msg.me .lv-bubble { background: #2d4a68; }
.lv-msg.sys .lv-bubble { background: none; color: var(--m-muted); font-size: 12.5px; text-align: center; padding: 4px 8px; }
.lv-typing { display: flex; align-items: center; gap: 4px; padding: 0 22px 8px; font-size: 12px; color: var(--m-faint); }
.lv-typing[hidden] { display: none; }
.lv-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--m-faint); animation: lv-bounce 1s infinite; }
.lv-typing i:nth-child(2) { animation-delay: .15s; } .lv-typing i:nth-child(3) { animation-delay: .3s; }
.lv-typing span { margin-left: 4px; }
@keyframes lv-bounce { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
.lv-compose { position: relative; display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--m-line); background: var(--m-surface); }
.lv-compose textarea { flex: 1 1 auto; resize: none; font-size: 14.5px; max-height: 140px; border-radius: 10px; }
.lv-compose .m-btn { min-height: 38px; }
.lv-compose [data-lv-canned] { position: absolute; left: 14px; right: 14px; bottom: 100%; }
.lv-canned { margin-bottom: 6px; border: 1px solid var(--m-line); border-radius: 10px; background: var(--m-surface); box-shadow: 0 10px 30px rgba(15, 25, 35, .16); overflow: hidden; max-height: 260px; overflow-y: auto; }
.lv-canned-row { display: flex; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--m-line-soft); background: none; color: var(--m-ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.lv-canned-row:last-child { border-bottom: 0; }
.lv-canned-row b { flex: 0 0 70px; color: var(--m-accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-canned-row span { flex: 1 1 auto; min-width: 0; color: var(--m-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-canned-row.on, .lv-canned-row:hover { background: var(--m-accent-soft); }
.lv-canned-empty { padding: 10px 12px; font-size: 12.5px; color: var(--m-muted); }

.lv-context { border-left: 1px solid var(--m-line); padding: 16px; overflow-y: auto; background: var(--m-surface); }
.lv-ctx-head { display: flex; gap: 11px; align-items: center; }
.lv-ctx-head > div { flex: 1 1 auto; min-width: 0; }
.lv-ctx-head b { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.lv-ctx-head small { display: block; font-size: 12px; color: var(--m-muted); }
.lv-ctx-score { display: flex; align-items: center; gap: 4px; margin: 14px 0; font-size: 12px; }
.lv-ctx-acts { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.lv-ctx-acts .m-btn { justify-content: center; white-space: normal; text-align: center; }
.lv-ctx-label { margin: 18px 0 6px; }

@media (max-width: 1180px) {
  .lv-chatgrid { grid-template-columns: 280px minmax(0, 1fr); }
  .lv-context { position: fixed; top: 56px; right: 0; bottom: 0; width: min(340px, 100vw); z-index: 40; transform: translateX(100%); transition: transform .18s ease; visibility: hidden; }
  .lv-context.open { transform: none; visibility: visible; box-shadow: -12px 0 40px rgba(15, 25, 35, .18); }
  .lv-details-btn, .lv-ctx-close { display: inline-flex !important; }
  .lv-liverow { grid-template-columns: 36px minmax(0, 1fr) 100px 160px 112px; }
  .lv-liverow .lv-lr-col.wide { display: none; }
}
@media (max-width: 900px) {
  .lv-cols, .lv-cols.even { grid-template-columns: minmax(0, 1fr); }
}

/* ---- phone: one pane at a time ---- */
@media (max-width: 700px) {
  /* The shared phone grid shares spare height between its two rows, which
     drops a short page to the middle of the screen. Here the strip takes what
     it needs and the page takes the rest. */
  .money-app.lv-app { grid-template-rows: auto minmax(0, 1fr); align-content: start; }
  .lv-side .lv-status { display: none; }
  .lv-two, .lv-three { grid-template-columns: 1fr; }
  .lv-fig { flex-basis: 40%; padding: 12px 10px 10px 0; }
  .lv-fig .v { font-size: 22px; }
  .lv-liverow { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; padding: 12px 0; }
  .lv-liverow .lv-lr-col { display: none; }
  .lv-app .lv-search { max-width: none; margin-left: 0; flex-basis: 100%; }
  .lv-toolbar .m-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .lv-toolbar select { flex: 1 1 100%; }
  .lv-table th:nth-child(n+4), .lv-table td:nth-child(n+4) { display: none; }
  .lv-person-head .m-actions { width: 100%; }
  .lv-person-head .m-actions .m-btn { flex: 1 1 auto; justify-content: center; min-height: 40px; }
  .lv-hour { grid-template-columns: 1fr 1fr; }
  .lv-hour .m-check { grid-column: 1 / -1; }
  .lv-hour > span { display: none; }
  .lv-cannedrow { grid-template-columns: minmax(0, 1fr) auto; }
  .lv-cannedrow textarea { grid-column: 1 / -1; grid-row: 2; }
  .lv-app input[type=text], .lv-app input[type=email], .lv-app input[type=number], .lv-app input[type=search], .lv-app select, .lv-app textarea { font-size: 16px; min-height: 42px; }

  /* the rail's pill strip stays on the inbox and goes away inside a chat */
  .lv-chatgrid { display: block; height: auto; min-height: 0; }
  .lv-inbox { border-right: 0; }
  .lv-inbox-list { overflow: visible; }
  .lv-inrow { padding: 14px 16px; min-height: 64px; }
  .lv-chatgrid .lv-convo-empty { display: none; }
  .lv-chatgrid.has-open .lv-inbox { display: none; }
  .lv-app.lv-bare:has(.lv-chatgrid.has-open) > .m-side { display: none; }
  .lv-chatgrid.has-open .lv-convo { position: fixed; left: 0; right: 0; top: calc(52px + env(safe-area-inset-top)); bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 30; }
  .lv-back { display: inline-flex !important; }
  .lv-convo-head { padding: 8px 10px; gap: 6px; }
  .lv-convo-acts .m-btn span { display: none; }
  .lv-convo-acts .m-btn { min-width: 40px; min-height: 40px; justify-content: center; }
  .lv-msgs { padding: 14px 12px 6px; }
  .lv-msg { max-width: 86%; }
  .lv-bubble { font-size: 15px; }
  .lv-compose { padding: 8px 10px; }
  .lv-compose .m-btn { min-height: 44px; min-width: 44px; }
  .lv-compose .m-btn span { display: none; }
  .lv-context { top: calc(52px + env(safe-area-inset-top)); bottom: calc(58px + env(safe-area-inset-bottom)); width: 100vw; }
}

/* the chat shortcut in the phone header, shown only while something is unread */
.lv-hdr-chat { position: relative; display: none; width: 38px; height: 38px; border-radius: 10px; align-items: center; justify-content: center; color: #fff !important; }
.lv-hdr-chat svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lv-hdr-chat i { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #e11d48; color: #fff; font-size: 10px; font-weight: 700; font-style: normal; display: flex; align-items: center; justify-content: center; }
@media (max-width: 700px) { .lv-hdr-chat:not([hidden]) { display: inline-flex; } }
