/* Messages: a calm, two-pane communication space. Tokens from app.css only; light and dark. */

/* ---------- compact header on the messaging screens */
.page-head.msg-hero { padding: var(--s5) var(--s6) var(--s4); margin-bottom: var(--s4); display: flex; align-items: flex-end;
  gap: var(--s4); flex-wrap: wrap; }
.msg-hero .msg-hero-text { flex: 1 1 320px; min-width: 0; }
.msg-hero .accent-bar { width: 36px; height: 3px; margin: var(--s2) 0 var(--s3); }
.msg-hero h1 { font-size: 24px; }
.msg-hero .subtitle { font-size: 14px; margin-top: 4px; }
.msg-hero .actions { margin-top: 0; }
.msg-hero .watermark { width: 200px; height: 200px; right: -30px; }

/* ---------- the two panes */
.msg-app { display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: var(--s4);
  height: clamp(540px, calc(100vh - 214px), 1400px); }
.msg-side, .msg-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.msg-pane { position: relative; }
.msg-pane-head, .msg-composer, .msg-join, .msg-composer-note, .msg-side-top, .msg-side-foot { flex: none; }

/* conversation list */
.msg-side { background: var(--surface); }
.msg-side-top { display: flex; gap: var(--s2); align-items: center; padding: var(--s3); border-bottom: 1px solid var(--border); }
.msg-search { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--s2); height: 32px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--muted); }
.msg-search:focus-within { border-color: var(--violet); box-shadow: var(--focus); background: var(--surface); }
.msg-search input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: var(--text); font: 400 13.5px/1 var(--font); height: 30px; }
.msg-search input:focus { outline: none; }
.msg-search input::-webkit-search-cancel-button { display: none; }
.msg-side-scroll { flex: 1 1 auto; overflow-y: auto; padding: var(--s2) var(--s2) var(--s3); scrollbar-width: thin; }
.msg-sec { display: flex; align-items: center; justify-content: space-between; font: 600 10.5px/1 var(--font); letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint); padding: var(--s4) var(--s2) 6px; }
.msg-sec:first-child { padding-top: var(--s2); }
.msg-sec a { letter-spacing: 0; text-transform: none; font-size: 12px; font-weight: 500; color: var(--muted); }
.msg-sec a:hover { color: var(--accent-text); }
.msg-row { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 4px var(--s2); border-radius: 8px; color: var(--text-2);
  font-size: 14px; position: relative; }
.msg-row:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.msg-row.active { background: var(--accent-soft); color: var(--text); }
.msg-row.active::before { content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--lavender), var(--violet)); }
.msg-row.unread { color: var(--text); font-weight: 650; }
.msg-row.muted { color: var(--faint); }
.msg-row .avatar { box-shadow: none; }
.msg-row-title { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-row-muted { color: var(--faint); display: inline-flex; }
.msg-ci { width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 7px; color: var(--muted); flex: none; }
.msg-ci.group { background: var(--surface-3); }
.msg-ci.accent { background: var(--accent-soft); color: var(--accent-text); }
.msg-ci.big { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); }
.msg-ci.big.accent { background: var(--accent-soft); color: var(--accent-text); }
.msg-row.active .msg-ci { color: var(--accent-text); }
.msg-count { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; font: 650 11px/18px var(--font);
  text-align: center; background: var(--surface-3); color: var(--text-2); flex: none; font-variant-numeric: tabular-nums; }
.msg-row.unread .msg-count { background: var(--primary); color: var(--on-primary); }
.msg-count.mention { background: var(--violet); color: #fff; }
.msg-count[hidden] { display: none; }
.msg-side-empty { font-size: 12.5px; color: var(--muted); padding: 4px var(--s2) var(--s2); margin: 0; }
.msg-side-foot { border-top: 1px solid var(--border); padding: var(--s2); }

/* conversation pane */
.msg-pane-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border);
  min-height: 64px; flex-wrap: wrap; }
.msg-back { display: none; width: 32px; height: 32px; border-radius: 8px; place-items: center; color: var(--text-2); margin-left: -6px; flex: none; }
.msg-back:hover { background: var(--surface-3); text-decoration: none; }
.msg-back.always { display: inline-grid; }
.msg-ph-text { flex: 1 1 200px; min-width: 0; }
.msg-ph-text h2 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-hash { color: var(--faint); font-weight: 600; margin-right: 1px; }
.msg-ph-meta { display: flex; flex-wrap: wrap; gap: 2px var(--s2); align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.msg-ph-meta > * + *::before { content: "·"; margin-right: var(--s2); color: var(--faint); }
.msg-ph-meta a { display: inline-flex; align-items: center; gap: 4px; }
.msg-ph-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.msg-ph-actions .btn.small { height: 32px; }
.msg-bridge-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); }

/* dropdowns (details) */
.msg-menu { position: relative; }
.msg-menu > summary { list-style: none; }
.msg-menu[open] > summary { background: var(--surface-3); }
.msg-drop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(320px, calc(100vw - 32px)); max-height: min(62vh, 480px);
  overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-pop);
  padding: var(--s3); }
.msg-drop.wide { width: min(360px, calc(100vw - 32px)); }
.msg-drop .form { gap: var(--s3); }
.msg-drop-title { display: flex; align-items: center; gap: 6px; font: 600 11px/1.2 var(--font); letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); margin: 2px 0 var(--s2); }
.msg-drop-sep { border-top: 1px solid var(--border); margin: var(--s3) calc(-1 * var(--s3)); }
.msg-pins, .msg-members { list-style: none; margin: 0; padding: 0; }
.msg-pins li a { display: grid; gap: 2px; padding: var(--s2); border-radius: 8px; color: var(--text); font-size: 13px; }
.msg-pins li a:hover { background: var(--surface-2); text-decoration: none; }
.msg-pins li a span { color: var(--text-2); }
.msg-members li { display: flex; align-items: center; gap: var(--s2); padding: 5px 0; }
.msg-members .grow { display: flex; flex-direction: column; line-height: 1.3; }
.msg-member-name { font-size: 13.5px; font-weight: 500; }
.msg-add { display: flex; gap: var(--s2); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--border); }
.msg-add .input { height: 32px; font-size: 13.5px; }
.msg-item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: var(--s2); width: 100%; min-height: 32px; padding: 6px var(--s2);
  border-radius: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.msg-item:hover { background: var(--surface-2); text-decoration: none; }
.msg-item:focus-visible { box-shadow: var(--focus); }
.msg-item .icon { color: var(--muted); }
.msg-item.danger, .msg-item.danger .icon { color: var(--danger); }

/* the message list: column-reverse keeps the newest in view without JavaScript */
.msg-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column-reverse; scrollbar-width: thin; }
.msg-scroll.plain { display: block; }
.msg-scroll:focus-visible { box-shadow: inset var(--focus); border-radius: 0; }
.msg-list { padding: var(--s3) 0 var(--s2); }
.msg-earlier { display: block; text-align: center; font-size: 13px; padding: var(--s2); }
.msg-start { padding: var(--s8) var(--s6) var(--s4); }
.msg-start h3 { margin: var(--s3) 0 4px; }
.msg-start.small-start { padding: var(--s3) var(--s5) 0; }
.msg-day, .msg-new, .msg-thread-sep { display: flex; align-items: center; gap: var(--s3); margin: var(--s4) var(--s5) var(--s2); font: 600 11.5px/1 var(--font);
  color: var(--muted); }
.msg-day::before, .msg-day::after, .msg-new::after, .msg-thread-sep::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.msg-day span { padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.msg-new { color: var(--violet); margin-top: var(--s2); }
.msg-new::after { border-top-color: color-mix(in srgb, var(--violet) 45%, transparent); }
.msg-thread-sep { margin-top: var(--s2); }

.msg { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--s3); padding: 6px var(--s5) 6px var(--s4);
  margin-top: 6px; }
.msg.compact { margin-top: 0; padding-top: 2px; padding-bottom: 2px; }
.msg:hover, .msg:focus-within { background: var(--surface-2); }
.msg:target { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--violet); }
.msg.pinned { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--warn) 70%, transparent); }
.msg-gutter { display: flex; justify-content: center; padding-top: 2px; }
.msg-hover-time { font: 500 10.5px/22px var(--font); color: var(--faint); opacity: 0; font-variant-numeric: tabular-nums; }
.msg:hover .msg-hover-time, .msg:focus-within .msg-hover-time { opacity: 1; }
.msg-main { min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; line-height: 1.35; }
.msg-author { font-weight: 650; font-size: 14.5px; color: var(--text); }
.msg-time, .msg-head time { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.msg-time:hover { color: var(--muted); }
.msg-edited { font-size: 11.5px; color: var(--faint); }
.msg-flag { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--warn); }
.msg-body { font-size: 14.5px; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; margin: 1px 0 0; }
.msg-body code { font-size: 12.5px; padding: 1px 5px; border-radius: 5px; background: var(--surface-3); border: 1px solid var(--border); }
.msg-body a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent-text) 35%, transparent); text-underline-offset: 2px; }
.msg-body strong { font-weight: 650; }
.msg-gone { color: var(--faint); font-style: italic; }
.msg-mention { display: inline; padding: 0 3px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600;
  text-decoration: none !important; }
.msg-mention.broadcast { background: var(--warn-soft); color: var(--warn); }
.msg.meeting .msg-body { padding: var(--s2) var(--s3); border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); display: inline-block; }
.msg-meeting-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; margin-top: 6px; }
.msg-files { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.msg-files a { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13px; }
.msg-files a:hover { border-color: var(--border-strong); text-decoration: none; }
.msg-files .icon { color: var(--muted); }
.msg-file-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; font-weight: 500; }
.msg-files .muted { font-size: 12px; }
.msg-marks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg-mark { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); }
.msg-mark.decision { background: var(--info-soft); color: var(--info); }
a.msg-mark:hover { text-decoration: none; background: var(--border); }
.msg-reacts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.msg-chip { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 600 12px/1 var(--font); cursor: pointer; white-space: nowrap; }
.msg-chip:hover { border-color: var(--border-strong); color: var(--text); }
.msg-chip:focus-visible { box-shadow: var(--focus); }
.msg-chip.mine { border-color: color-mix(in srgb, var(--violet) 45%, transparent); background: var(--accent-soft); color: var(--accent-text); }
.msg-chip[disabled] { cursor: default; }
.msg-chip-n { font-variant-numeric: tabular-nums; color: var(--muted); }
.msg-chip.mine .msg-chip-n { color: inherit; }
.msg-thread-link { display: inline-flex; align-items: center; gap: var(--s2); margin-top: 6px; padding: 3px 10px 3px 8px; border-radius: 8px; font-size: 13px;
  font-weight: 600; border: 1px solid transparent; }
.msg-thread-link:hover { text-decoration: none; background: var(--surface); border-color: var(--border); }
.msg-thread-link .muted { font-weight: 400; font-size: 12px; }
.msg-sys { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; padding: 4px var(--s5) 4px 30px; font-size: 13px; color: var(--muted); }
.msg-sys-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); margin-right: 18px; }
.msg-sys time { font-size: 11.5px; color: var(--faint); }

/* actions that appear on hover or focus */
.msg-actions { position: absolute; right: var(--s4); top: -12px; display: flex; align-items: center; gap: 1px; padding: 2px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-2); opacity: 0; pointer-events: none; z-index: 5; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions, .msg-actions:has(details[open]) { opacity: 1; pointer-events: auto; }
.msg-act { all: unset; box-sizing: border-box; width: 30px; height: 28px; display: inline-grid; place-items: center; border-radius: 7px; color: var(--muted);
  cursor: pointer; list-style: none; }
.msg-act::-webkit-details-marker { display: none; }
.msg-act:hover, .msg-menu[open] > .msg-act { background: var(--surface-3); color: var(--text); text-decoration: none; }
.msg-act:focus-visible { box-shadow: var(--focus); }
.msg-act.on { color: var(--accent-text); }
.msg-pop { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 20; min-width: 220px; padding: 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-pop); }
.msg-pop form { margin: 0; }
.msg-pop-acks { min-width: 0; }
.msg-pop-acks form { display: flex; gap: 5px; }
.msg:first-of-type .msg-pop { bottom: auto; top: calc(100% + 6px); }

/* the composer */
.msg-composer { position: relative; margin: var(--s2) var(--s4) var(--s4); border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface);
  box-shadow: var(--shadow-1); }
.msg-composer:focus-within { border-color: var(--violet); box-shadow: var(--focus); }
.msg-composer textarea { display: block; width: 100%; min-height: 46px; max-height: 220px; resize: none; border: 0; background: transparent; color: var(--text);
  font: 400 14.5px/1.5 var(--font); padding: 12px var(--s4) 4px; }
.msg-composer textarea:focus { outline: none; }
.msg-composer-bar { display: flex; align-items: center; gap: var(--s2); padding: 4px 6px 6px 8px; }
.msg-attach { position: relative; width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; color: var(--muted); cursor: pointer; flex: none; }
.msg-attach:hover { background: var(--surface-3); color: var(--text); }
.msg-attach:focus-within { box-shadow: var(--focus); }
.msg-attach input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.msg-file-name { font-size: 12.5px; color: var(--accent-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 40%; }
.msg-file-name:empty { display: none; }
.msg-hint { flex: 1 1 auto; min-width: 0; font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-send { margin-left: auto; }
.msg-composer-error { margin: 0 var(--s4) var(--s2); font-size: 12.5px; color: var(--danger); }
.msg-mention-pop { position: absolute; left: var(--s3); bottom: calc(100% + 6px); z-index: 25; list-style: none; margin: 0; padding: 4px; width: min(300px, calc(100% - 24px));
  max-height: 240px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-pop); }
.msg-mention-pop li { display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s2); border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.msg-mention-pop li[aria-selected="true"], .msg-mention-pop li:hover { background: var(--accent-soft); }
.msg-mention-pop .avatar { --s: 22px; }
.msg-composer-note, .msg-join { margin: var(--s2) var(--s4) var(--s4); padding: var(--s3) var(--s4); border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text-2); font-size: 13.5px; }
.msg-join { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; justify-content: space-between; }
.msg-edit { display: grid; gap: var(--s2); margin-top: 4px; }

/* overview and search results */
.msg-overview { padding: var(--s4) var(--s5) var(--s6); }
.msg-ov-title { display: flex; align-items: center; gap: var(--s2); font-size: 13px; font-weight: 650; color: var(--text-2); margin: var(--s4) 0 var(--s2); }
.msg-ov-title:first-child { margin-top: 0; }
.msg-ov-title .icon { color: var(--accent-text); }
.msg-ov-list, .msg-results { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.msg-ov-item, .msg-result { display: grid; gap: 4px; padding: var(--s3) var(--s4); border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); }
.msg-ov-item:hover, .msg-result:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.msg-ov-item.unread { border-color: color-mix(in srgb, var(--violet) 35%, var(--border)); box-shadow: inset 3px 0 0 var(--violet); }
.msg-ov-head, .msg-result-who { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-size: 13.5px; }
.msg-ov-head .status { margin-left: auto; }
.msg-ov-text, .msg-result-body { color: var(--text-2); font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.msg-ov-meta { font-size: 12px; color: var(--faint); }
.msg-ov-empty { margin: 0; }
.msg-ov-tips { margin-top: var(--s6); padding: var(--s4); border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.msg-ov-tips ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; display: grid; gap: 4px; }
.msg-ov-tips .msg-ov-title { margin-top: 0; }
.msg-results { padding: var(--s4) var(--s5); }
.msg-result-where { font-size: 12px; font-weight: 600; color: var(--accent-text); }
.msg-result-who time { font-size: 12px; color: var(--faint); }

/* announcements */
.msg-ann-scroll { padding: var(--s4) var(--s5) var(--s6); }
.msg-ann { padding: var(--s5); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.msg-ann + .msg-ann { margin-top: var(--s3); }
.msg-ann.unread { border-color: color-mix(in srgb, var(--violet) 35%, var(--border)); box-shadow: inset 3px 0 0 var(--violet); }
.msg-ann-head { display: flex; gap: var(--s3); align-items: flex-start; flex-wrap: wrap; }
.msg-ann-head > .grow { flex: 1 1 0; min-width: 160px; }
.msg-ann-head h3 { font-size: 17px; line-height: 1.3; }
.msg-ann-meta { display: flex; flex-wrap: wrap; gap: 2px var(--s2); font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.msg-ann-meta > * + *::before { content: "·"; margin-right: var(--s2); color: var(--faint); }
.msg-ann-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.msg-ann-body { margin: var(--s3) 0 0 52px; font-size: 14.5px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; max-width: 70ch; }
.msg-ann-foot { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin: var(--s4) 0 0 52px; padding-top: var(--s3); border-top: 1px solid var(--border); }
.msg-ann-receipt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.msg-ann-meter { width: 120px; height: 6px; }
.msg-ann-missing { flex-basis: 100%; }
.msg-ann-missing > summary { display: inline-flex; }
.msg-ann-withdraw { margin-left: auto; }
.msg-ann-new { padding: var(--s5); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); margin-bottom: var(--s4); }
.msg-ann-new h3 { font-size: 16px; }
.msg-target { border: 0; padding: 0; margin: 0; min-width: 0; }
.msg-target legend { font: 600 13px/1.3 var(--font); color: var(--text-2); padding: 0; }
.msg-target .hint { font-size: 12.5px; color: var(--muted); margin: 4px 0 var(--s2); }
.msg-target-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.msg-ann-new > .hint { font-size: 12.5px; color: var(--muted); margin: -8px 0 0; }
.msg-ann-bridge { margin-top: var(--s5); padding: var(--s3) var(--s4); border-radius: 12px; border: 1px dashed var(--border-strong); }
.msg-ann-bridge > summary { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.msg-ann-bridge[open] > summary { margin-bottom: var(--s3); }

/* saved items */
.msg-saved { list-style: none; margin: 0; padding: var(--s4) var(--s5); display: grid; gap: var(--s3); }
.msg-saved-item { border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s3) var(--s4); background: var(--surface); }
.msg-saved-where { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; font-size: 12.5px; font-weight: 600; margin-bottom: var(--s2); }
.msg-saved-where .muted { font-weight: 400; }
.msg-saved-msg { display: flex; gap: var(--s3); }
.msg-saved-actions { display: flex; gap: 4px; justify-content: flex-end; margin-top: var(--s2); flex-wrap: wrap; }

/* new conversation, meeting, eDiscovery */
.msg-tabs { margin-bottom: var(--s4); }
.msg-new-card { max-width: 820px; }
.msg-people { max-height: 440px; overflow-y: auto; border-top: 1px solid var(--border); }
.msg-people.short { max-height: 300px; }
.msg-people > li { min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
.msg-people .check { gap: var(--s3); }
.msg-people .title { font-weight: 500; }
.msg-vis { border: 0; margin: 0; padding: 0; display: grid; gap: var(--s2); min-width: 0; }
.msg-vis legend { font: 600 13px/1.3 var(--font); color: var(--text-2); padding: 0; margin-bottom: var(--s2); }
.msg-opt { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.msg-opt:has(input:checked) { border-color: var(--violet); background: var(--accent-soft); }
.msg-opt.disabled { opacity: .65; cursor: not-allowed; }
.msg-opt input { margin-top: 3px; accent-color: var(--violet); }
.msg-opt strong { display: flex; align-items: center; gap: 5px; font-weight: 600; }
.msg-opt .hint { display: block; font-size: 12.5px; color: var(--muted); }
.msg-meet-people { padding-bottom: 0; }
.msg-meet-people .list { margin: var(--s2) calc(-1 * var(--s5)) 0; }
.msg-export { display: flex; align-items: flex-end; gap: var(--s3); flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.msg-export .hint.full { flex-basis: 100%; margin: 0; font-size: 12.5px; color: var(--muted); }
.msg-ed-item { align-items: flex-start; }
.msg-ed-where { font-weight: 600; color: var(--text-2); }
.msg-ed-body { margin-top: 4px; font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg-ed-old { margin-top: 4px; padding-left: var(--s3); border-left: 2px solid var(--border-strong); font-size: 13px; color: var(--text-2); white-space: pre-wrap;
  overflow-wrap: anywhere; }

/* ---------- smaller screens */
@media (max-width: 1180px) { .msg-app { grid-template-columns: 260px minmax(0, 1fr); } .msg-hint, .msg-hide-sm { display: none; } }
@media (max-width: 900px) {
  .msg-app { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 176px); min-height: 460px; }
  .msg-app.has-open .msg-side { display: none; }
  .msg-app:not(.has-open) .msg-pane { display: none; }
  .msg-back { display: inline-grid; }
  .msg-hero .subtitle, .msg-hero .watermark { display: none; }
  .page-head.msg-hero { padding: var(--s4) var(--s5); }
  .msg-hero h1 { font-size: 21px; }
  .msg-hero .accent-bar { margin: 6px 0 var(--s2); }
}
@media (max-width: 600px) {
  .msg-app { height: calc(100dvh - 160px); gap: 0; }
  .msg-pane-head { padding: var(--s2) var(--s3); gap: var(--s2); min-height: 56px; }
  .msg-ph-text { flex-basis: 120px; }
  .msg-hide-sm { display: none; }
  .msg { padding-left: var(--s2); padding-right: var(--s3); gap: var(--s2); grid-template-columns: 34px minmax(0, 1fr); }
  .msg .avatar { --s: 32px !important; }
  .msg-actions { right: var(--s2); }
  .msg-day, .msg-new, .msg-thread-sep { margin-left: var(--s3); margin-right: var(--s3); }
  .msg-composer { margin: var(--s2); }
  .msg-overview, .msg-ann-scroll, .msg-results, .msg-saved { padding-left: var(--s3); padding-right: var(--s3); }
  .msg-ann { padding: var(--s4); }
  .msg-ann-body, .msg-ann-foot { margin-left: 0; }
  .msg-ann-tags { flex-basis: 100%; margin-left: 52px; }
  .msg-target-grid { grid-template-columns: minmax(0, 1fr); }
  .msg-file-title { max-width: 160px; }
  .msg-sys { padding-left: var(--s3); }
  .msg-sys-dot { margin-right: 6px; }
}
@media (hover: none) {
  .msg-actions { opacity: .92; pointer-events: auto; position: static; grid-column: 2; justify-self: start; margin-top: 2px; box-shadow: none; border-color: transparent;
    background: transparent; padding: 0; }
  .msg-act { width: 32px; height: 28px; }
  .msg-pop { right: auto; left: 0; }
}
