/* Coven's look for coven.hexwork.co.uk (layout_coven.php), in Hexwork's family: Syne for titles, Geist for text,
   near-black with Hexwork's pink-red (#F0245E) as the one accent, like HexMail, HexOffice, Tally and Pact. Light mode
   comes from the shared tokens (theme.php). The app fills the window like Teams: a rail, the list of conversations,
   the conversation. The one thing that stands out: a message that mentions you carries the accent down its edge.
   Phone first: at narrow widths the list and the conversation take turns and the rail sits along the bottom. */
:root {
  color-scheme: dark;
  --link: #FF4D6A;
  --link-hi: #FF7A90;
  --acc: #F0245E;
  --on-acc: #fff;
  --acc-deep: #CC1A4D;
  --ink: #F6F1F3;
  --muted: #ABA0A6;
  --paper: #09070A;
  --card: #120E13;
  --raised: #1A141C;
  --sunk: #0C090D;
  --rule: #2A222C;
  --rule-strong: #43374A;
  --tint: rgba(240, 36, 94, 0.12);
  --hover: #241B26;
  --hover-line: #5A4A60;
  --bad: #FF6B6B;
  --ok: #4ADE80;
  --display: "Syne", "Arial Black", system-ui, sans-serif;
  --body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --focus: 0 0 0 2px var(--paper), 0 0 0 4px var(--link);
  --rail: 68px;
  --list: 300px;
}
:root[data-theme="light"] { --acc: #C2103F; --acc-deep: #A30D35; --on-acc: #fff; --tint: rgba(194, 16, 63, 0.07); --link: #B00D3A; --link-hi: #8A0A2D; --hover: #E9E3E6; --hover-line: #8F8289; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1rem/1.5 var(--body); color: var(--ink); background: var(--paper); overflow-wrap: break-word; }
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--link-hi); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.15; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; padding: 8px 12px; background: var(--raised); color: var(--ink); border-radius: 8px; }
.skip:focus { top: 8px; }
.muted { color: var(--muted); }
.fine { font-size: 0.86rem; color: var(--muted); }
.cv-i { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Buttons and fields ---- */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--raised); color: var(--ink); font: 600 0.98rem/1.2 var(--body); text-decoration: none; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.btn:hover { background: var(--hover); border-color: var(--hover-line); color: var(--ink); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }
.btn-primary:hover { background: var(--acc-deep); border-color: var(--acc-deep); color: var(--on-acc); }
.btn-quiet { background: transparent; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 0.9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
label { display: block; font-weight: 600; font-size: 0.9rem; margin: 0 0 6px; }
.field { margin: 0 0 14px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.84rem; margin-top: 4px; }
input[type=text], input[type=search], input[type=email], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--rule-strong); border-radius: 9px; background: var(--sunk); color: var(--ink); font: 400 1rem/1.4 var(--body);
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--link); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--acc); vertical-align: middle; margin: 0; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; margin: 0 0 8px; }
.check input { flex-shrink: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; padding: 0; }
.cv-inline { display: inline; margin: 0; }

/* ---- Flashes and toasts ---- */
.flash { margin: 0 0 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--rule-strong); background: var(--raised); }
.flash-ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.flash-error { border-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.cv-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.cv-toasts .flash { margin: 0; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); transition: opacity 0.3s; }
.cv-toasts .flash.cv-gone { opacity: 0; }

/* ---- Frame for pages that aren't the app (landing, messages) ---- */
.cv-top { border-bottom: 1px solid var(--rule); }
.cv-top-in { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cv-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 1.3rem/1 var(--display); }
.cv-acct { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.cv-acct form { margin: 0; }
.cv-main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
.cv-foot { border-top: 1px solid var(--rule); padding: 20px 16px; color: var(--muted); font-size: 0.86rem; text-align: center; }
.cv-foot p { margin: 0; display: inline-flex; gap: 8px; align-items: center; }
.cv-panel { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 24px; }
.cv-msgpage { max-width: 560px; margin: 40px auto; }
.cv-hero { padding: clamp(24px, 6vw, 64px) 0 28px; max-width: 760px; }
.cv-hero h1 { font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1.02; }
.cv-hero p { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.cv-points { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin: 12px 0 28px; border-top: 1px solid var(--rule); }
.cv-points div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); }
.cv-points dt { font-weight: 700; margin-bottom: 2px; }
.cv-points dd { margin: 0; color: var(--muted); font-size: 0.95rem; }
.cv-note { padding: 10px 12px; border-radius: 10px; background: var(--tint); }

/* ---- The app ---- */
.cv-app { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.cv-app .skip { position: absolute; }
.cv-shell { flex: 1; min-height: 0; display: flex; }
.cv-wrap { flex: 1; min-width: 0; display: grid; grid-template-columns: var(--rail) var(--list) minmax(0, 1fr); min-height: 0; }

/* The rail */
.cv-rail { display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; border-right: 1px solid var(--rule); background: var(--sunk); }
.cv-rail a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 0.68rem; font-weight: 600; position: relative; white-space: nowrap; letter-spacing: -0.01em; }
.cv-rail a:hover { color: var(--ink); background: var(--hover); }
.cv-rail a[aria-current="page"] { color: var(--ink); background: var(--raised); }
.cv-rail a[aria-current="page"]::before { content: ""; position: absolute; left: -6px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--acc); }
.cv-rail-i { position: relative; display: inline-grid; place-items: center; }
.cv-rail-out { margin-top: auto; }
.cv-badge { position: absolute; top: -6px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--acc); color: var(--on-acc); font: 700 0.68rem/18px var(--body); text-align: center; }

/* The list */
.cv-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--rule); background: var(--card); }
.cv-list-h { display: flex; align-items: center; gap: 8px; padding: 14px 12px 8px 16px; }
.cv-list-t { font-size: 1.25rem; margin: 0; margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-filter { position: relative; margin: 0 12px 8px; }
.cv-filter .cv-i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.cv-filter input { min-height: 38px; padding-left: 34px; font-size: 0.95rem; }
.cv-items { list-style: none; margin: 0; padding: 0 6px 8px; overflow-y: auto; flex: 1; min-height: 0; }
.cv-archived .cv-items { flex: none; }
.cv-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.cv-item:hover { background: var(--hover); color: var(--ink); }
.cv-item[aria-current="page"] { background: var(--raised); box-shadow: inset 3px 0 0 var(--acc); }
.cv-item-b { flex: 1; min-width: 0; display: grid; }
.cv-item-top { display: flex; gap: 8px; align-items: baseline; }
.cv-item-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cv-item-w { flex: none; font-size: 0.76rem; color: var(--muted); }
.cv-item-p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.86rem; color: var(--muted); }
.cv-item.is-unread .cv-item-n { font-weight: 700; }
.cv-item.is-unread .cv-item-p { color: var(--ink); }
.cv-pill { flex: none; min-width: 22px; padding: 1px 7px; border-radius: 11px; background: var(--acc); color: var(--on-acc); font-size: 0.75rem; font-weight: 700; text-align: center; display: inline-flex; align-items: center; gap: 2px; }
.cv-empty-li { padding: 12px 10px; color: var(--muted); font-size: 0.92rem; }
.cv-list-foot { margin: 0; padding: 8px 12px; border-top: 1px solid var(--rule); }
.cv-list-foot a { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; text-decoration: none; }
.cv-archived { padding: 0 6px 8px; border-top: 1px solid var(--rule); max-height: 40%; overflow-y: auto; }
.cv-archived summary { cursor: pointer; padding: 10px 6px; color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.cv-list-note { padding: 0 16px; color: var(--muted); font-size: 0.92rem; }

/* Avatars: initials on one of six quiet tints of Hexwork's dark (no second accent) */
.cv-av { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font: 700 0.82rem/1 var(--body); color: #F6F1F3; background: #3A1D2A; }
.cv-t1 { background: #2B2236; } .cv-t2 { background: #1E2B33; } .cv-t3 { background: #33261A; } .cv-t4 { background: #1F2E26; } .cv-t5 { background: #36202A; }
.cv-av-ch, .cv-av-group { background: var(--raised); color: var(--muted); border-radius: 10px; border: 1px solid var(--rule); }
:root[data-theme="light"] .cv-av:not(.cv-av-ch):not(.cv-av-group) { color: #1C1519; background: #F2D9E1; }
:root[data-theme="light"] .cv-t1 { background: #E3DAF0; } :root[data-theme="light"] .cv-t2 { background: #D5E5EE; } :root[data-theme="light"] .cv-t3 { background: #F1E1CC; } :root[data-theme="light"] .cv-t4 { background: #D7EBDD; } :root[data-theme="light"] .cv-t5 { background: #F0D6DD; }

/* The conversation */
.cv-conv { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--paper); }
.cv-ch { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.cv-ch-t { flex: 1; min-width: 0; }
.cv-ch-t h2 { font-size: 1.15rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-ch-t p { margin: 0; color: var(--muted); font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-back { display: none; color: var(--ink); padding: 8px; margin-left: -8px; border-radius: 8px; }
.cv-tabs { display: flex; gap: 2px; }
.cv-tabs a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.cv-tabs a:hover { color: var(--ink); background: var(--hover); }
.cv-tabs a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--acc); border-radius: 8px 8px 0 0; }
.cv-tab-n { color: var(--muted); font-weight: 500; }

.cv-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 0 8px; overscroll-behavior: contain; }
.cv-older { text-align: center; margin: 4px 0 12px; }
.cv-start { text-align: center; color: var(--muted); padding: 24px 16px; margin: 0; }
.cv-day, .cv-new { display: flex; align-items: center; gap: 12px; margin: 14px 16px 6px; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.cv-day::before, .cv-day::after, .cv-new::before, .cv-new::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.cv-new { color: var(--link); }
.cv-new::before, .cv-new::after { background: color-mix(in srgb, var(--acc) 55%, transparent); }
.cv-m { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 0 12px; padding: 6px 16px 4px; margin-top: 6px; }
.cv-m.cv-cont { margin-top: 0; padding-top: 1px; }
.cv-m:hover, .cv-m:focus-within { background: var(--card); }
.cv-m-side { font-size: 0.72rem; color: var(--muted); text-align: right; padding-top: 4px; opacity: 0; }
.cv-m:hover .cv-m-side, .cv-m:focus-within .cv-m-side { opacity: 1; }
.cv-m-b { min-width: 0; }
.cv-m-h { margin: 0 0 1px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cv-m-h strong { font-weight: 700; }
.cv-m-h time, .cv-m-via { font-size: 0.78rem; color: var(--muted); }
.cv-m-t { line-height: 1.5; max-width: 76ch; overflow-wrap: anywhere; }
.cv-m-t p, .cv-m-t ul, .cv-m-t ol, .cv-m-t blockquote, .cv-m-t pre { margin: 0.25em 0; }
.cv-m-t ul, .cv-m-t ol { padding-left: 1.4em; }
.cv-m-t blockquote { border-left: 3px solid var(--rule-strong); padding-left: 10px; color: var(--muted); }
.cv-m-t code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; background: var(--raised); border: 1px solid var(--rule); border-radius: 5px; padding: 0 4px; }
.cv-m-t pre { background: var(--sunk); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre-wrap; }
.cv-m-t pre code { background: none; border: 0; padding: 0; }
.cv-m-del { margin: 0; color: var(--muted); font-style: italic; }
.cv-m-ed { font-size: 0.75rem; color: var(--muted); }
.cv-at { font-weight: 600; color: var(--link); }
.cv-at-me { color: var(--on-acc); background: var(--acc); border-radius: 5px; padding: 0 4px; }
.cv-m:has(.cv-at-me), .cv-m:has(.cv-at-all) { box-shadow: inset 3px 0 0 var(--acc); background: var(--tint); }
.cv-sys { margin: 8px 16px; padding-left: 48px; color: var(--muted); font-size: 0.88rem; }
.cv-sys strong { color: var(--ink); font-weight: 600; }
.cv-sys time { font-size: 0.75rem; margin-left: 4px; }
.cv-m.is-flash { animation: cv-flash 1.6s ease-out; }
@keyframes cv-flash { from { background: var(--tint); } to { background: transparent; } }

/* The message's menu */
.cv-mm { position: relative; align-self: start; }
.cv-mm summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); opacity: 0; }
.cv-mm summary::-webkit-details-marker { display: none; }
.cv-m:hover .cv-mm summary, .cv-mm summary:focus-visible, .cv-mm[open] summary { opacity: 1; }
.cv-mm summary:hover { background: var(--hover); color: var(--ink); }
.cv-mm-in { position: absolute; right: 0; top: 34px; z-index: 5; min-width: 150px; padding: 6px; border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--raised); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.cv-mm-in a, .cv-mm-in button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--ink); font: 500 0.92rem/1.2 var(--body); text-decoration: none; cursor: pointer; text-align: left; }
.cv-mm-in a:hover, .cv-mm-in button:hover { background: var(--hover); }
.cv-mm-in form { margin: 0; }
.cv-editing textarea { min-height: 64px; margin: 4px 0 6px; }

/* Writing */
.cv-compose { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "tools tools" "text send"; gap: 6px 8px; margin: 0 16px 14px; padding: 6px 8px 8px; border: 1px solid var(--rule-strong); border-radius: 12px; background: var(--card); }
.cv-compose:focus-within { border-color: var(--link); }
.cv-tools { grid-area: tools; display: flex; gap: 2px; }
.cv-tools button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; }
.cv-tools button:hover { background: var(--hover); color: var(--ink); }
.cv-compose textarea { grid-area: text; min-height: 40px; max-height: 40vh; padding: 8px 4px; border: 0; background: transparent; resize: none; overflow-y: auto; }
.cv-compose textarea:focus-visible { box-shadow: none; }
.cv-send { grid-area: send; align-self: end; min-height: 40px; padding: 8px 14px; }
.cv-compose-note { margin: 0 16px 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 0.92rem; }
.cv-mention { position: absolute; left: 8px; bottom: calc(100% + 6px); z-index: 6; width: min(320px, calc(100% - 16px)); max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--raised); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.cv-mention [role=option] { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.cv-mention [role=option] .cv-av { width: 28px; height: 28px; font-size: 0.7rem; }
.cv-mention [aria-selected="true"], .cv-mention [role=option]:hover { background: var(--hover); }
.cv-mention small { color: var(--muted); }

/* Panels in place of the conversation */
.cv-pane { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 16px 40px; width: 100%; max-width: 640px; }
.cv-pane-wide { max-width: 820px; }
.cv-pane-t { font-size: 1.3rem; }
.cv-pane h3 { font-size: 1rem; margin-top: 8px; }
.cv-form { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.cv-danger { display: flex; flex-wrap: wrap; gap: 8px; }
.cv-danger form { margin: 0; }
.cv-people, .cv-browse, .cv-acts { list-style: none; margin: 0 0 24px; padding: 0; border-top: 1px solid var(--rule); }
.cv-people li, .cv-browse li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.cv-people-n, .cv-browse-n { flex: 1; min-width: 160px; display: grid; }
.cv-people-n span, .cv-browse-n span { color: var(--muted); font-size: 0.88rem; }
.cv-browse-n { color: var(--ink); text-decoration: none; }
.cv-browse-n:hover strong { text-decoration: underline; }
.cv-search { display: flex; gap: 8px; margin-bottom: 16px; }
.cv-acts li { border-bottom: 1px solid var(--rule); }
.cv-acts a { display: flex; gap: 10px; padding: 12px 8px; color: var(--ink); text-decoration: none; border-radius: 8px; }
.cv-acts a:hover { background: var(--hover); }
.cv-acts li.is-unread a { box-shadow: inset 3px 0 0 var(--acc); }
.cv-act-b { display: grid; gap: 2px; min-width: 0; }
.cv-act-h time { margin-left: 8px; color: var(--muted); font-size: 0.8rem; }
.cv-act-t { color: var(--muted); }
.cv-pick input[type=search] { margin-bottom: 8px; }
.cv-pick ul { list-style: none; margin: 0; padding: 4px; max-height: 300px; overflow-y: auto; border: 1px solid var(--rule); border-radius: 10px; }
.cv-pick li { padding: 4px 6px; border-radius: 8px; }
.cv-pick li:hover { background: var(--hover); }
.cv-pick .check { margin: 0; }
.cv-pick .cv-av { width: 30px; height: 30px; font-size: 0.72rem; }
.cv-blank { margin: auto; text-align: center; padding: 24px; color: var(--muted); max-width: 360px; }
.cv-blank img { opacity: 0.85; margin-bottom: 8px; }

/* The conversation and a thread beside it */
.cv-body { flex: 1; min-height: 0; display: flex; }
.cv-main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cv-thread { flex: none; width: min(400px, 40%); display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--rule); background: var(--card); }
.cv-thread-h { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--rule); }
.cv-thread-h h3 { margin: 0; font-size: 1.05rem; }
.cv-x { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; color: var(--muted); }
.cv-x:hover { background: var(--hover); color: var(--ink); }
.cv-troot { border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.cv-tcount { margin: 8px 16px 0; color: var(--muted); font-size: 0.84rem; font-weight: 600; }
.cv-thread .cv-compose { margin: 0 12px 12px; }
.cv-away { margin: 0; padding: 8px 16px; background: var(--tint); font-size: 0.9rem; border-bottom: 1px solid var(--rule); }

/* A message's tools: react, reply, more (they show on hover or focus, like Teams) */
.cv-acts-bar { display: flex; gap: 2px; align-self: start; align-items: center; }
.cv-acts-bar > .cv-mm summary, .cv-act-btn { opacity: 0; }
.cv-m:hover .cv-acts-bar > .cv-mm summary, .cv-m:hover .cv-act-btn, .cv-m:focus-within .cv-acts-bar > .cv-mm summary, .cv-m:focus-within .cv-act-btn, .cv-acts-bar > .cv-mm[open] summary { opacity: 1; }
.cv-act-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.cv-act-btn:hover { background: var(--hover); color: var(--ink); }
.cv-rpick-in { display: flex; gap: 2px; min-width: 0; padding: 4px; }
.cv-rpick-in form { margin: 0; }
.cv-rpick-in button { width: 38px; height: 38px; padding: 0; justify-content: center; }
.cv-reacts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.cv-reacts form { margin: 0; }
.cv-react { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 3px 9px; border: 1px solid var(--rule-strong); border-radius: 15px; background: var(--raised); color: var(--ink); font: 600 0.82rem/1 var(--body); cursor: pointer; }
.cv-react:hover { border-color: var(--hover-line); }
.cv-react.is-mine { border-color: var(--link); background: var(--tint); }
.cv-react[disabled] { cursor: default; }
.cv-m-pin { display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; color: var(--link); font-weight: 600; }
.cv-m.is-pinned { box-shadow: inset 3px 0 0 var(--rule-strong); }

/* Files on a message */
.cv-files { list-style: none; margin: 6px 0 2px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cv-file-img a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--rule); background: var(--sunk); }
.cv-file-img img { display: block; max-width: min(320px, 100%); max-height: 240px; object-fit: contain; }
.cv-file { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 360px; padding: 8px 8px 8px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); color: var(--muted); }
.cv-file-n { flex: 1; min-width: 0; display: grid; }
.cv-file-n a { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.cv-file-n a:hover { text-decoration: underline; }
.cv-file-n span { font-size: 0.78rem; }
.cv-file-dl { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; color: var(--muted); }
.cv-file-dl:hover { background: var(--hover); color: var(--ink); }

/* The way into a post's thread */
.cv-thread-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 4px 8px 4px 4px; border-radius: 8px; color: var(--link); text-decoration: none; font-size: 0.88rem; }
.cv-thread-link:hover { background: var(--hover); }
.cv-thread-link .muted { font-size: 0.8rem; }
.cv-faces { display: inline-flex; }
.cv-faces .cv-av { width: 22px; height: 22px; font-size: 0.56rem; border: 2px solid var(--paper); }
.cv-faces .cv-av + .cv-av { margin-left: -6px; }

/* Attaching files */
.cv-attach { display: grid; place-items: center; width: 32px; height: 32px; margin: 0; border-radius: 7px; color: var(--muted); cursor: pointer; position: relative; }
.cv-attach:hover { background: var(--hover); color: var(--ink); }
.cv-attach input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.cv-attach:focus-within { box-shadow: var(--focus); }
.cv-chips { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cv-chips li { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 4px 4px 10px; border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--raised); font-size: 0.86rem; }
.cv-chips li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-chips button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.cv-chips button:hover { background: var(--hover); color: var(--ink); }
.cv-compose.is-drop { border-color: var(--link); background: var(--tint); }

/* Files and Pinned tabs, search */
.cv-ftable { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.cv-ftable th { text-align: left; font-size: 0.8rem; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--rule-strong); }
.cv-ftable td { padding: 10px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.cv-ftable-n { display: inline-flex; gap: 8px; align-items: center; color: var(--ink); font-weight: 600; text-decoration: none; }
.cv-ftable-n:hover { text-decoration: underline; }
.cv-pins { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.cv-pins li { border-bottom: 1px solid var(--rule); padding: 4px 0 8px; }
.cv-pins-go { margin: 0 16px; padding-left: 48px; font-size: 0.88rem; }
.cv-sform { padding: 0 12px; }
.cv-sform .cv-filter { margin: 0 0 8px; }
.cv-tips { margin: 8px 0 0; display: grid; gap: 6px; }
.cv-tips div { display: grid; }
.cv-tips dt { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.84rem; color: var(--ink); }
.cv-tips dd { margin: 0; font-size: 0.84rem; }
mark { background: var(--tint); color: var(--ink); border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -2px 0 var(--acc); }

/* Not room for a thread beside the conversation: it takes the conversation's place */
@media (max-width: 1100px) {
  .cv-wrap.has-thread .cv-main-col { display: none; }
  .cv-thread { width: 100%; border-left: 0; }
}

/* ---- Narrow screens: the list and the conversation take turns; the rail goes to the bottom ---- */
@media (max-width: 760px) {
  .cv-wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .cv-rail { grid-row: 2; flex-direction: row; justify-content: space-around; border-right: 0; border-top: 1px solid var(--rule); padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); }
  .cv-rail a { flex: 1; }
  .cv-rail a[aria-current="page"]::before { left: 25%; right: 25%; top: -4px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .cv-rail-out { margin-top: 0; }
  .cv-list, .cv-conv { grid-row: 1; grid-column: 1; border-right: 0; }
  .cv-wrap.has-conv .cv-list { display: none; }
  .cv-wrap:not(.has-conv) .cv-conv { display: none; }
  .cv-back { display: inline-grid; }
  .cv-ch { padding: 8px 12px; }
  .cv-tabs { width: 100%; overflow-x: auto; }
  .cv-m { padding-left: 12px; padding-right: 8px; }
  .cv-compose { margin: 0 8px 8px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
/* Touch screens have no hover: a message's tools stay in view */
@media (hover: none) { .cv-acts-bar > .cv-mm summary, .cv-act-btn, .cv-mm summary { opacity: 1; } }

/* T2: an email or a contact shared into a conversation */
.cv-card { display: flex; gap: 12px; max-width: 460px; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); min-width: 0; }
.cv-card-i { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--sunk); color: var(--ink); }
.cv-card-b { flex: 1; min-width: 0; }
.cv-card-b p { margin: 0; }
.cv-card-k { font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-card-t { font-weight: 600; margin-top: 2px !important; }
.cv-card-t a { color: var(--ink); text-decoration: none; }
.cv-card-t a:hover { text-decoration: underline; }
.cv-card-x { margin-top: 4px !important; font-size: 0.86rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cv-card-o { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 8px !important; font-size: 0.82rem; }
.cv-card-o a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; white-space: nowrap; }
.cv-share .cv-card { margin: 0 0 16px; }
.cv-where .check { margin-top: 6px; }
.cv-where-in { margin: 6px 0 10px 28px; }
.cv-where select { max-width: 100%; }
@media (max-width: 520px) { .cv-where-in { margin-left: 0; } }
