/* Messenger r21: bounded panes and visible controls; retain compact media. */
.messages-view {
  --mc-ink: #20372d;
  --mc-muted: #5b6962;
  --mc-line: #e2e8e4;
  --mc-accent: #285d4b;
  --mc-paper: #fff;
  height: calc(100dvh - var(--messenger-top-space, 154px));
  min-height: 0;
  max-width: 1240px;
  color: var(--mc-ink);
}
.messages-view *, .mc-dialog * { box-sizing: border-box; }
.messages-view ::selection { background: #d2e6d7; color: #173d2b; }
.messages-view :is(input, textarea) { caret-color: var(--mc-accent); }
.messages-view :is(p, h1, h2, h3, strong, button, a) { hyphens: none; word-break: normal; }
.messages-view :is(button, a, input, textarea, summary):focus-visible {
  outline: 2px solid #307450;
  outline-offset: 3px;
}
.messages-view .messages-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  border: 1px solid var(--mc-line);
  border-radius: 14px;
  box-shadow: none;
  overflow: hidden;
}
.messages-view .thread-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fff;
  border-right: 1px solid var(--mc-line);
}
.messages-view .thread-list-head { padding: 13px 13px 5px; min-height: 57px; }
.messages-view .thread-list-head h1 {
  font-family: inherit;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -.015em;
}
.messages-view .thread-list-head .btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  color: #4c6755;
  background: transparent;
}
.messages-view .thread-list-head .btn:hover { background: #edf2e9; }
.messages-view .thread-list-head .btn span { display: none; }
.messages-view .thread-list-head .btn svg { width: 19px; height: 19px; }
.messages-view .thread-list-tools { display: flex; align-items: center; gap: 3px; flex: none; }
.messages-view .thread-list-tools .mc-icon-button { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 8px; border-radius: 10px; }
.messages-view .thread-search {
  margin: 4px 12px 10px;
  padding: 8px 10px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #f2f5f3;
}
.messages-view .thread-search:focus-within { border-color: #96b19b; }
.messages-view .thread-search input { font-size: 13px; }
.messages-view .thread-search input::placeholder { color: #57695d; opacity: 1; }
.messages-view .thread-list-items {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 6px 6px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #bdcbbd transparent;
}
.messages-view .thread-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 82px;
  width: 100%;
  margin: 1px 0;
  padding: 12px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--mc-ink);
  text-align: left;
  transition: background-color 140ms ease-out;
}
.messages-view .thread-item[hidden] { display: none; }
.messages-view .thread-item:hover { background: #f3f6f4; }
.messages-view .thread-item.selected { background: #eef2ef; box-shadow: none; }
.messages-view .thread-avatar { display: block; position: relative; width: 56px; height: 56px; flex: none; }
.messages-view .thread-avatar .avatar { width: 56px; height: 56px; font-size: 16px; }
.messages-view .thread-avatar [data-presence-user-id] { display: none; }
.messages-view .thread-avatar [data-presence-state="online"] {
  display: block;
  position: absolute;
  right: -1px;
  bottom: 0;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 2px solid var(--mc-paper);
  border-radius: 50%;
  background: #35834c;
}
.messages-view .thread-avatar .presence-dot { display: none; }
.messages-view .thread-avatar .presence-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.messages-view .thread-summary { min-width: 0; flex: 1; }
.messages-view .thread-title-line, .messages-view .thread-preview-line { display: flex; align-items: center; min-width: 0; gap: 6px; }
.messages-view .thread-title-line { justify-content: space-between; }
.messages-view .thread-title-line strong {
  min-width: 0;
  flex: 1;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 650;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.messages-view .thread-date {
  display: block;
  flex: none;
  max-width: none;
  padding: 0;
  align-self: center;
  font-size: 11px;
  line-height: 1.4;
  color: var(--mc-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.messages-view .thread-preview-line { margin-top: 4px; }
.messages-view .thread-preview-line p {
  min-width: 0;
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--mc-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: left;
  overflow-wrap: normal;
}
.messages-view .thread-you { color: #335940; }
.messages-view .thread-preview-line .message-receipt { width: 18px; height: 16px; }
.messages-view .thread-unread {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #326c4b;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.messages-view .thread-privacy { display: flex; align-items: center; gap: 7px; padding: 12px 13px; min-height: 43px; font-size: 11px; color: #47634e; }
.messages-view .thread-privacy svg { width: 15px; height: 15px; flex: none; }
.messages-view .messages-list-empty { padding: 14px 10px; line-height: 1.6; }
.messages-view .conversation { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; background: #fff; position: relative; min-width: 0; isolation: isolate; }
.messages-view .conversation-head { min-height: 65px; padding: 9px 15px; gap: 10px; background: var(--mc-paper); border-bottom: 1px solid var(--mc-line); }
.messages-view .conversation-head > .avatar { width: 39px; height: 39px; flex: none; }
.messages-view .conversation-peer { min-width: 0; border-radius: 5px; }
.messages-view .conversation-peer h2 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin: 0 0 2px; font-family: inherit; font-size: 14px; line-height: 1.4; font-weight: 600; }
.messages-view .conversation-peer > span { font-size: 11px; line-height: 1.5; }
.messages-view .conversation-peer > .muted { color: var(--mc-muted); }
.messages-view .conversation-peer:has([data-presence-state="online"]) > .muted { display: none; }
.messages-view .mc-chat-menu { margin-left: 0; }
.messages-view .mc-chat-menu summary { width: 36px; height: 36px; border-radius: 9px; color: #4e6554; }
.messages-view .mc-chat-menu summary:hover { background: #edf2e9; }
.messages-view .mc-chat-menu summary svg { width: 21px; height: 21px; }
.messages-view .mc-chat-menu > div { z-index: 20; min-width: 180px; border-radius: 10px; }
.messages-view .mc-chat-menu :is(a, button) { min-height: 40px; border-radius: 6px; font-size: 12px; }
.messages-view .mc-chat-menu :is(a, button):hover { background: #edf2e9; }
.messages-view .conversation-history {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  flex: 1;
  min-height: 0;
  max-height: none;
  padding: 12px 21px 16px;
  background: #fff;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #bdcbbd transparent;
  overflow-x: hidden;
  overflow-y: auto;
}
.messages-view .message-day { align-self: center; margin: 6px 0 7px; color: #607168; font-size: 11px; line-height: 1.45; text-align: center; }
.messages-view .message-day time { display: inline-block; padding: 3px 9px; background: #e9eeeb; border-radius: 6px; }
.messages-view .message-bubble {
  position: relative;
  width: fit-content;
  min-width: 82px;
  max-width: min(82%, 560px);
  padding: 8px 11px 4px;
  border: 0;
  border-radius: 12px 12px 12px 4px;
  box-shadow: none;
  overflow: visible;
}
.messages-view .message-bubble.incoming { background: #fff; border: 1px solid #e8ede9; }
.messages-view .message-bubble.outgoing { border: 1px solid transparent; border-radius: 12px 12px 4px 12px; background: #eef4ef; color: #264132; }
.messages-view .message-bubble.outgoing > p { color: #264132; }
.messages-view .message-bubble > p { font-size: 15px; line-height: 1.55; margin: 0; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Chat lines keep natural spacing; long editorial prose retains justification. */
#main .messages-view .message-bubble > p { text-align: left !important; text-align-last: left !important; }
.messages-view .message-footer { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin: 0; height: auto; min-height: 0; }
.messages-view .message-footer time { margin: 0; font-size: 10px; line-height: 1.4; color: #52634f; font-variant-numeric: tabular-nums; }
.messages-view .message-footer .message-report {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  max-height: 24px;
  padding: 6px;
  margin: 0 auto 0 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #526b5b;
  cursor: pointer;
  opacity: 1;
}
.messages-view .message-footer .message-report svg { display: block; width: 12px; height: 12px; }
.messages-view .message-bubble:hover .message-report, .messages-view .message-bubble:focus-within .message-report { opacity: 1; }
.messages-view .message-footer .message-report:hover, .messages-view .message-footer .message-report:focus-visible { opacity: 1; background: #e8efea; }
.messages-view .message-footer .message-receipt { flex: none; }
.messages-view .message-bubble.outgoing .message-footer time { color: #466250; }
.messages-view .message-bubble.outgoing .message-report { color: #466250; }
.messages-view .message-bubble.outgoing .message-report:is(:hover, :focus-visible) { background: #dfeae2; }
.messages-view .message-bubble.outgoing .message-receipt { color: #466250; }
.messages-view .message-bubble.outgoing .message-receipt.is-read { color: #126ba4; }
.messages-view .message-footer .message-receipt svg { height: 14px; width: 17px; }
.messages-view .message-bubble.is-voice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 5px;
  width: 420px;
  max-width: 100%;
  min-width: 0;
  padding: 5px 6px;
  border-radius: 10px;
}
.messages-view .message-bubble.is-voice > .mc-message-attachments,
.messages-view .message-bubble.is-voice .mc-audio-message { display: contents; margin: 0; }
.messages-view .message-bubble.is-voice .mc-voice-player { grid-column: 1; grid-row: 1; width: 100%; height: 32px; min-height: 32px; gap: 5px; }
.messages-view .message-bubble.is-voice .message-footer { grid-column: 2; grid-row: 1; align-self: center; flex-wrap: nowrap; height: 32px; min-height: 32px; gap: 3px; margin: 0; }
.messages-view .message-bubble.is-voice .message-footer time { font-size: 9px; white-space: nowrap; }
.messages-view .message-bubble.is-voice .message-report { margin: 0; background: transparent; }
.messages-view .message-bubble.is-voice .mc-transcript { grid-column: 1/-1; grid-row: 2; min-width: 0; margin: 6px 0 2px; }
.messages-view .message-bubble.is-voice .mc-voice-timeline { min-width: 30px; }
.messages-view .message-bubble.is-voice .mc-shared-media > a.text-link { display: none; }
.messages-view .conversation-empty { margin: auto; padding: 28px 18px; max-width: 320px; align-self: center; text-align: center; }
.messages-view .conversation-empty h3 { margin: 0 0 8px; font-size: 16px; font-family: inherit; }
.messages-view .conversation-empty p { font-size: 13px; line-height: 1.6; color: var(--mc-muted); text-align: center; margin: 0; }
.messages-view .mc-message-attachments { margin: 3px 0; gap: 6px; }
.mc-photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 122px; width: 360px; max-width: 100%; gap: 3px; overflow: hidden; border-radius: 8px; }
.mc-photo-grid > .mc-photo-item { display: block; min-width: 0; min-height: 0; position: relative; line-height: 0; overflow: hidden; background: #e1e7db; }
.mc-photo-grid > .mc-photo-item img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.mc-photo-grid .mc-photo-open { display: block; width: 100%; height: 100%; }
.mc-photo-grid .mc-photo-download { position: absolute; top: 5px; right: 5px; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; min-height: 32px; padding: 7px; border-radius: 7px; background: #fff; color: #244c37; box-shadow: 0 2px 7px #17332426; opacity: 0; }
.mc-photo-grid .mc-photo-download svg { width: 18px; height: 18px; }
.mc-photo-grid .mc-photo-item:is(:hover, :focus-within) .mc-photo-download { opacity: 1; }
@media (hover: none) { .mc-photo-grid .mc-photo-download { opacity: 1; } }
.mc-photo-grid[data-count="1"] { display: block; width: min(360px, 100%); }
.mc-photo-grid[data-count="1"] > .mc-photo-item img { width: 100%; height: auto; max-height: 360px; object-fit: contain; }
.mc-photo-grid[data-count="3"] > .mc-photo-item:first-child { grid-row: span 2; }
.mc-photo-grid[data-count="2"] { grid-auto-rows: 170px; }
.mc-photo-grid[data-count="5"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.mc-photo-grid[data-count="5"] > .mc-photo-item { grid-column: span 2; }
.mc-photo-grid[data-count="5"] > .mc-photo-item:nth-child(-n+2) { grid-column: span 3; }
.mc-photo-grid:is([data-count="6"], [data-count="7"], [data-count="8"], [data-count="9"], [data-count="10"], [data-count="11"], [data-count="12"]) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mc-photo-grid:is([data-count="7"], [data-count="10"]) > .mc-photo-item:last-child { grid-column: span 3; }
.mc-photo-grid:is([data-count="8"], [data-count="11"]) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.mc-photo-grid:is([data-count="8"], [data-count="11"]) > .mc-photo-item { grid-column: span 2; }
.mc-photo-grid:is([data-count="8"], [data-count="11"]) > .mc-photo-item:nth-last-child(-n+2) { grid-column: span 3; }
.mc-photo-grid .mc-photo-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: white; background: #14261f80; font-size: 24px; line-height: 1; }
.messages-view .mc-shared-file { max-width: 100%; gap: 9px; padding: 9px; border: 1px solid #dce5d5; border-radius: 8px; background: #ffffff70; }
.messages-view .mc-shared-file strong { font-size: 12px; line-height: 1.45; }
.messages-view .mc-shared-file span { color: #56694f; }
.messages-view .mc-shared-file .text-link { min-height: 24px; font-size: 11px; }
.messages-view .mc-reference { border-radius: 8px; background: #ffffff70; padding: 9px; }
.messages-view .mc-shared-media { margin: 0; gap: 4px; }
.messages-view .mc-video-circle > video { display: block; width: min(240px, 100%); height: auto; max-height: 240px; aspect-ratio: 1; border-radius: 50%; object-fit: cover; background: #192c21; }
.messages-view .mc-draft-item video { display: block; width: min(240px, 100%); max-width: 240px; max-height: 240px; }
.messages-view .mc-voice-player {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: 290px;
  max-width: 100%;
  min-width: 0;
  min-height: 34px;
  gap: 7px;
  padding: 0;
  color: #35684f;
}
.messages-view .mc-voice-player audio { display: none; }
.messages-view .mc-voice-player .mc-voice-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  flex: 0 0 32px;
  padding: 8px;
  border: 0;
  border-radius: 50%;
  background: #2b6a51;
  color: white;
  cursor: pointer;
}
.messages-view .mc-voice-player .mc-voice-play:hover { background: #1c513c; }
.messages-view .mc-voice-player .mc-voice-play svg { width: 16px; height: 16px; min-width: 16px; min-height: 16px; fill: currentColor; }
.messages-view .mc-voice-timeline { position: relative; display: block; flex: 1; min-width: 38px; height: 30px; color: #3e8160; }
.messages-view .mc-voice-timeline .mc-waveform { display: block; width: 100%; height: 30px; pointer-events: none; }
.messages-view .mc-voice-timeline input {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  min-width: 0;
  height: 30px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  accent-color: #356c4e;
  cursor: pointer;
}
.messages-view .mc-voice-timeline input::-webkit-slider-runnable-track { height: 2px; background: #b7cfc1; border-radius: 2px; }
.messages-view .mc-voice-timeline input::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 7px; height: 7px; margin-top: -2.5px; border: 0; border-radius: 50%; background: #377c58; }
.messages-view .mc-voice-timeline input::-moz-range-track { height: 2px; background: #b7cfc1; }
.messages-view .mc-voice-timeline input::-moz-range-thumb { width: 7px; height: 7px; border: 0; border-radius: 50%; background: #377c58; }
.messages-view .mc-voice-timeline.has-waveform input::-webkit-slider-runnable-track { background: transparent; }
.messages-view .mc-voice-timeline.has-waveform input::-moz-range-track { background: transparent; }
.messages-view .mc-voice-timeline.has-waveform input::-webkit-slider-thumb { opacity: 0; }
.messages-view .mc-voice-timeline.has-waveform input::-moz-range-thumb { opacity: 0; }
.messages-view .mc-voice-timeline:focus-within { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 3px; }
.messages-view .mc-voice-time { font-size: 10px; line-height: 1.3; flex: none; color: #44614d; font-variant-numeric: tabular-nums; }
.messages-view .mc-voice-player :is(.mc-transcribe, .mc-voice-download) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  flex: 0 0 28px;
  padding: 5px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #3d684e;
  text-decoration: none;
}
.messages-view .mc-voice-player .mc-transcribe { font-size: 15px; line-height: 1; }
.messages-view .mc-voice-player .mc-transcribe[aria-expanded="true"] { background: #dbeadf; }
.messages-view .mc-voice-player :is(.mc-transcribe, .mc-voice-download):hover { background: #e5efe8; }
.messages-view .mc-voice-download svg { display: block; width: 16px; height: 16px; }
/* Status stays available to assistive technology without opening another row. */
.messages-view .mc-voice-player .mc-transcript-state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
.messages-view .mc-transcript[hidden] { display: none; }
.messages-view .mc-transcript { margin: 7px 0 3px; padding-top: 8px; border-top: 1px solid #dce7de; font-size: 13px; line-height: 1.6; color: #304f3c; text-align: left; }
.messages-view .mc-transcript :is(p, .mc-muted) { margin: 0 0 6px; font-size: 12px; line-height: 1.6; text-align: left; }
.messages-view .mc-transcript button { font: inherit; font-size: 11px; min-height: 30px; padding: 5px 8px; border-radius: 6px; }
.messages-view .message-bubble.outgoing .mc-voice-player { color: #3d7255; }
.messages-view .message-bubble.outgoing .mc-voice-play { background: #285d4b; color: #fff; }
.messages-view .message-bubble.outgoing .mc-voice-play:hover { background: #1c513c; }
.messages-view .message-bubble.outgoing .mc-voice-timeline { color: #4b8263; }
.messages-view .message-bubble.outgoing .mc-voice-time { color: #466250; }
.messages-view .message-bubble.outgoing :is(.mc-transcribe, .mc-voice-download) { color: #4e725b; }
.messages-view .message-bubble.outgoing :is(.mc-transcribe, .mc-voice-download):is(:hover, [aria-expanded="true"]) { background: #dae9df; }
.messages-view .message-bubble.outgoing .mc-voice-timeline input::-webkit-slider-runnable-track { background: #8db8a2; }
.messages-view .message-bubble.outgoing .mc-voice-timeline input::-webkit-slider-thumb { background: #3a7b54; }
.messages-view .message-bubble.outgoing .mc-voice-timeline input::-moz-range-track { background: #8db8a2; }
.messages-view .message-bubble.outgoing .mc-voice-timeline input::-moz-range-thumb { background: #3a7b54; }
.messages-view .message-bubble.outgoing .mc-voice-timeline.has-waveform input::-webkit-slider-runnable-track { background: transparent; }
.messages-view .message-bubble.outgoing .mc-voice-timeline.has-waveform input::-moz-range-track { background: transparent; }
.messages-view .message-bubble.outgoing .mc-transcript { color: #3c5d46; border-color: #d1dfd5; }
.messages-view .message-bubble.outgoing .mc-transcript :is(p, .mc-muted, .mc-transcript-text, .mc-segment) { color: #3c5d46; }
.messages-view .message-bubble.outgoing :is(.mc-reference, .mc-shared-file) { border-color: #d3e1d7; background: #ffffff80; color: #304c39; }
.messages-view .message-bubble.outgoing :is(.mc-reference, .mc-shared-file) :is(strong, span, a, svg) { color: #3b5e45; }
.messages-view .message-bubble.outgoing .mc-shared-media > a.text-link,
.messages-view .message-bubble.outgoing .mc-media-tools .mc-muted { color: #687b6d; }
.messages-view .mc-media-tools { font-size: 11px; }
.messages-view .mc-shared-media > a.text-link { font-size: 10px; min-height: 18px; line-height: 1.5; color: #486441; }
.messages-view .mc-composer-shell { position: relative; z-index: 3; border-top: 1px solid var(--mc-line); background: var(--mc-paper); }
.messages-view .mc-composer.message-reply-form { border: 0; padding: 6px 9px; background: transparent; }
.messages-view .mc-compose-line { gap: 4px; align-items: flex-end; }
.messages-view .mc-compose-line textarea { min-height: 42px; max-height: 116px; padding: 10px 11px; border: 1px solid #dfe7d9; border-radius: 8px; background: #f6f8f6; color: var(--mc-ink); font-size: 14px; line-height: 20px; }
.messages-view .mc-compose-line textarea::placeholder { color: #57695d; opacity: 1; }
.messages-view .mc-compose-line textarea:focus { outline: 2px solid #285d4b; outline-offset: 1px; }
.messages-view .mc-icon-button { width: 36px; height: 40px; min-width: 36px; min-height: 40px; padding: 8px; border-radius: 10px; }
.messages-view .mc-icon-button svg { width: 18px; height: 18px; }
.messages-view .mc-compose-line > [data-mc-scheduled] { width: 32px; min-width: 32px; }
.messages-view .mc-send-control { gap: 3px; height: 42px; }
.messages-view .mc-send-button, .messages-view .mc-record-button { width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 9px; border-radius: 11px; }
.messages-view .mc-compose-line .mc-send-control :is(.mc-send-button, .mc-record-button) { box-sizing: border-box; width: 40px; height: 40px; min-width: 40px; min-height: 40px; max-width: 40px; max-height: 40px; flex: 0 0 40px; padding: 10px; border-radius: 8px; }
.messages-view .mc-compose-line .mc-send-control :is(.mc-send-button, .mc-record-button) svg { width: 18px; height: 18px; flex: none; }
.messages-view .mc-compose-line .mc-send-control .mc-send-button { background: #285d4b; color: white; }
/* These dimensions override the legacy #main button minimum of 44px. */
#main .messages-view .message-footer .message-report { box-sizing: border-box; width: 24px; min-width: 24px; height: 24px; min-height: 24px; max-height: 24px; padding: 6px; }
#main .messages-view .mc-voice-player .mc-voice-play { box-sizing: border-box; width: 32px; min-width: 32px; height: 32px; min-height: 32px; max-height: 32px; padding: 8px; }
#main .messages-view .mc-voice-player :is(.mc-transcribe, .mc-voice-download) { box-sizing: border-box; width: 28px; min-width: 28px; height: 28px; min-height: 28px; max-height: 28px; padding: 5px; }
#main .messages-view .mc-compose-line .mc-icon-button { box-sizing: border-box; height: 40px; min-height: 40px; max-height: 40px; }
#main .messages-view .mc-compose-line .mc-send-control :is(.mc-send-button, .mc-record-button) { box-sizing: border-box; width: 40px; min-width: 40px; max-width: 40px; height: 40px; min-height: 40px; max-height: 40px; padding: 10px; }
#main .messages-view .thread-list-tools :is(.mc-icon-button, .btn) { box-sizing: border-box; width: 36px; min-width: 36px; height: 36px; min-height: 36px; max-height: 36px; padding: 8px; }
#main .messages-view .mc-chat-menu > div :is(a, button) { min-height: 36px; padding: 8px 10px; line-height: 20px; }
#main .messages-view .mc-recording-bar button { box-sizing: border-box; width: 32px; min-width: 32px; height: 32px; min-height: 32px; max-height: 32px; padding: 6px; }
.messages-view .mc-record-button { background: #285d4b; color: #fff; border: 0; }
.messages-view .mc-record-button:hover { background: #1c513c; }
.messages-view .mc-send-control > [data-mc-options] { width: 26px; min-width: 26px; padding: 4px; }
.messages-view .mc-send-control > [data-mc-options] svg { width: 18px; height: 18px; }
.messages-view .mc-record-button[hidden], .messages-view .mc-send-button[hidden], .messages-view [data-mc-options][hidden] { display: none; }
.messages-view [data-mc-record-mode][hidden] { display: none; }
.messages-view .mc-composer .mc-live,
.messages-view .mc-composer .mc-recorder-help { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.messages-view .mc-error { font-size: 12px; line-height: 1.5; margin: 5px 0 0; }
.messages-view .mc-inline-dock { background: #f6f8f1; border-color: var(--mc-line); padding: 7px 10px; }
.messages-view .mc-inline-dock .btn, .messages-view .group-notice .btn { border-radius: 8px; min-height: 36px; padding: 7px 12px; font-size: 12px; }
.messages-view .mc-draft-attachments { max-height: 180px; overflow-y: auto; scrollbar-width: thin; }
.messages-view .mc-draft-item { border-radius: 8px; padding: 5px 7px; }
.messages-view .mc-draft-item audio { display: block; width: min(280px, 100%); height: 34px; max-width: 100%; }
.messages-view .mc-draft-item.mc-draft-voice { display: flex; align-items: center; gap: 5px; min-height: 44px; padding: 5px 6px; background: #f5f8f5; border: 1px solid #dce6dd; border-radius: 8px; }
.messages-view .mc-draft-voice > .mc-voice-player { flex: 1; width: auto; min-width: 0; height: 32px; min-height: 32px; }
.messages-view .mc-draft-voice > .mc-draft-voice-status { flex: 1; min-width: 0; margin: 0; font-size: 11px; line-height: 1.4; color: #5d7062; }
.messages-view .mc-draft-voice-status progress { width: min(130px, 100%); height: 3px; margin-top: 3px; }
#main .messages-view .mc-draft-voice > :is([data-mc-remove], [data-mc-retry]) { flex: none; width: 28px; min-width: 28px; height: 28px; min-height: 28px; max-height: 28px; padding: 6px; border-radius: 6px; }
#main .messages-view .mc-draft-voice > [data-mc-remove] { width: 24px; min-width: 24px; height: 24px; min-height: 24px; max-height: 24px; padding: 4px; }
#main .messages-view .mc-draft-voice > [data-mc-retry] { width: auto; font-size: 11px; padding: 5px 7px; }
.messages-view .mc-composer.has-voice-draft { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; padding: 5px 7px; }
.messages-view .has-voice-draft > .mc-draft-attachments { grid-column: 1; min-width: 0; max-height: none; padding: 0; margin: 0; }
.messages-view .has-voice-draft > .mc-compose-line { display: contents; }
.messages-view .has-voice-draft > .mc-compose-line > :is([data-mc-attach], label, textarea, [data-mc-scheduled], [data-mc-record-mode]) { display: none; }
.messages-view .has-voice-draft .mc-send-control { grid-column: 2; align-self: center; height: 40px; margin: 0; }
.messages-view .has-voice-draft > :is(.mc-compose-summary, .mc-error) { grid-column: 1/-1; }
.messages-view .has-voice-draft > .mc-compose-summary { margin: 0; padding-bottom: 5px; }
.messages-view .has-voice-draft .mc-draft-voice .mc-voice-player { gap: 6px; }
.messages-view .mc-draft-thumbnail { width: 42px; height: 42px; border-radius: 6px; }
.messages-view .mc-recording-bar { min-height: 46px; gap: 6px; padding: 5px 8px; border: 0; background: #f3f7f3; flex-wrap: nowrap; }
.messages-view .mc-recording-bar[hidden] { display: none; }
.messages-view .mc-composer-shell.is-recording .mc-compose-line { display: none; }
.messages-view .mc-composer-shell.is-recording .mc-draft-attachments { display: none; }
.messages-view .mc-composer-shell.is-recording .mc-composer { padding-block: 0; }
.messages-view .mc-composer-shell.is-recording .mc-recording-bar { min-height: 46px; padding: 5px 8px; }
.messages-view .mc-recording-bar:has(> video:not([hidden])) { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; min-height: 0; flex: none; }
.messages-view .mc-recording-bar > video { display: block; grid-column: 1/-1; justify-self: center; width: min(264px, calc(100% - 12px), max(64px, calc(var(--mc-surface-height, 600px) - 130px))); height: auto; aspect-ratio: 1; max-height: none; border-radius: 50%; object-fit: cover; flex: none; }
.messages-view .mc-recording-bar > [data-mc-record-time] { color: #9a433a; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.messages-view .mc-record-hint { min-width: 0; color: #4f664d; font-size: 11px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.messages-view .mc-record-controls { display: flex; align-items: center; gap: 3px; margin-left: auto; flex: none; }
.messages-view .mc-recording-bar :is([data-mc-record-pause], [data-mc-record-stop], [data-mc-record-cancel]) { width: 36px; height: 36px; min-width: 36px; min-height: 36px; padding: 8px; border-radius: 9px; flex: none; }
.messages-view .mc-recording-bar [data-mc-record-stop] { color: white; background: var(--mc-accent); }
.messages-view .mc-recording-bar.is-paused { background: #f9f4e7; }
.messages-view .mc-recording-bar.is-paused > [data-mc-record-time] { color: #745b26; }
.messages-view .mc-record-lock { display: inline-flex; gap: 4px; align-items: center; color: #325e40; font-size: 11px; }
.messages-view .mc-record-lock svg { width: 15px; height: 15px; }
.messages-view .mc-recorder-help { margin: 3px 2px 0; color: #66746c; font-size: 10px; line-height: 14px; max-height: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left; }
.messages-view .mc-recorder-help[hidden] { display: none; }
.messages-view .mc-composer-shell:not([data-record-status="idle"]) .mc-recorder-help { display: none; }
.messages-view .mc-record-dot { width: 7px; height: 7px; border-radius: 50%; background: #ad4d41; flex: none; }
.messages-view .mc-recording-bar.is-paused .mc-record-dot { background: #886c36; }
.messages-view .mc-recording-bar [data-mc-record-lock] { position: static; width: 36px; height: 36px; min-width: 36px; min-height: 36px; padding: 8px; border-radius: 9px; flex: none; }
.messages-view .mc-recording-bar [hidden] { display: none; }
.messages-view .conversation-info :is(.btn, .peer-tabs button, .peer-notifications) { border-radius: 8px; }
.messages-view .peer-shared-items .mc-photo-grid { width: 100%; grid-auto-rows: 130px; }
.messages-view .peer-shared-items .mc-photo-grid[data-count="1"] { display: grid; grid-template-columns: 1fr; grid-auto-rows: auto; }
/* Help stays in the header here; its floating launcher cannot cover recording. */
body:has(.messages-view) .archive-help-launcher { display: none !important; }
body:has(.messages-view) .archive-help:has(.archive-help-panel:not([hidden])),
body:has(.messages-view) #archive-help-widget:has(.archive-help-panel:not([hidden])) { display: block !important; }
@media (min-width: 761px) and (max-width: 1100px) {
  .messages-view .messages-layout { grid-template-columns: 270px minmax(0, 1fr); }
  .messages-view .thread-item { gap: 8px; padding-inline: 7px; }
  .messages-view .thread-avatar, .messages-view .thread-avatar .avatar { width: 52px; height: 52px; }
  .messages-view .conversation-history { padding-inline: 12px; }
  .messages-view .message-bubble { max-width: 91%; }
}
@media (max-width: 760px) {
  .messages-view { height: auto; min-height: 0; }
  .messages-view .messages-layout { grid-template-columns: 1fr; border-radius: 12px; }
  .messages-view:not(.mc-chat-active) .thread-list { min-height: 68dvh; }
  .messages-view .thread-list-head { min-height: 58px; padding: 11px 13px 6px; }
  .messages-view .thread-list-head h1 { font-size: 19px; }
  .messages-view .thread-search { margin-bottom: 7px; min-height: 41px; }
  .messages-view .thread-search input { font-size: 16px; }
  .messages-view .thread-item { min-height: 80px; padding: 11px 9px; gap: 11px; }
  .messages-view .thread-avatar, .messages-view .thread-avatar .avatar { width: 56px; height: 56px; }
  .messages-view .thread-title-line strong { font-size: 14px; }
  .messages-view .thread-preview-line p { font-size: 14px; }
  .messages-view .thread-date { font-size: 11px; }
  .messages-view.mc-chat-active { height: 100%; min-height: 0; max-width: none; }
  .messages-view.mc-chat-active .messages-layout { display: flex; min-height: 0; height: 100%; border: 0; border-radius: 0; }
  .messages-view.mc-chat-active .thread-list { display: none; }
  .messages-view.mc-chat-active .conversation { height: 100%; width: 100%; min-height: 0; }
  .messages-view .conversation-head { min-height: 62px; padding: max(8px, env(safe-area-inset-top)) 10px 8px 5px; gap: 7px; }
  .messages-view .conversation-head > .avatar { width: 36px; height: 36px; }
  .messages-view .mc-chat-back { width: 34px; height: 40px; border-radius: 8px; }
  .messages-view .mc-chat-back svg { width: 21px; height: 21px; }
  .messages-view .conversation-history { padding: 10px 9px 12px; gap: 6px; }
  .messages-view .message-bubble { max-width: 91%; padding: 8px 10px 4px; }
  .messages-view .message-bubble > p { font-size: 15px; line-height: 1.5; }
  #main .messages-view .message-footer .message-report { width: 24px; height: 24px; min-width: 24px; min-height: 24px; padding: 6px; opacity: .7; }
  .messages-view .message-day { margin-block: 6px; }
  .messages-view .mc-composer.message-reply-form { padding: 7px 6px; }
  .messages-view .mc-compose-line { gap: 3px; }
  .messages-view .mc-compose-line textarea { font-size: 16px; line-height: 22px; min-height: 42px; padding: 9px; }
  .messages-view .mc-compose-line > .mc-icon-button { width: 34px; min-width: 34px; height: 40px; padding: 7px; }
  .messages-view .mc-compose-line > [data-mc-scheduled] { width: 28px; min-width: 28px; padding: 5px; }
  .messages-view .mc-send-control > [data-mc-options] { width: 23px; min-width: 23px; padding: 3px; }
  .messages-view .mc-photo-grid { grid-auto-rows: 103px; }
  .messages-view .mc-photo-grid[data-count="2"] { grid-auto-rows: 140px; }
  .messages-view .mc-recording-bar { padding: 7px 8px; gap: 6px; }
  .messages-view .mc-record-hint { font-size: 11px; }
  .messages-view .mc-recorder-help { margin: 3px 2px 0; font-size: 10px; line-height: 14px; }
  .messages-view .mc-voice-player { width: 258px; gap: 6px; }
  .messages-view .mc-voice-play { width: 32px; height: 32px; min-width: 32px; }
  .messages-view .mc-voice-player .mc-transcribe { width: 28px; height: 28px; min-width: 28px; min-height: 28px; }
  .messages-view .mc-transcript { font-size: 13px; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .messages-view *, .mc-dialog * { transition: none; animation: none; scroll-behavior: auto; }
}

/* The outer page stays still; navigation, history and auxiliary panels scroll
 * independently. Browser bars, zoom and an expanded notice cannot hide Send. */
@media (min-width: 761px) {
  body:has(.messages-view) { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
  body:has(.messages-view) > :is(.topbar, .dev-strip, .place-context-bar, #launch-notice-host) { flex: none; }
  body:has(.messages-view) #launch-notice-host { max-height: clamp(60px, 26dvh, 220px); overflow-y: auto; overscroll-behavior: contain; }
  body:has(.messages-view) .app-layout { flex: 1; min-height: 0; width: 100%; padding-block: 12px; overflow: hidden; }
  body:has(.messages-view) #main { display: flex; flex-direction: column; height: 100%; min-height: 0; }
  body:has(.messages-view) .sidebar { position: static; align-self: stretch; height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  #main .messages-view { flex: 1; width: 100%; height: 100%; min-height: 0; min-width: 0; }
}
@media (min-width: 761px) and (max-height: 500px) {
  .messages-view .conversation-head { min-height: 52px; padding-block: 6px; }
  .messages-view .conversation-head > .avatar { width: 34px; height: 34px; }
  body:has(.messages-view) .app-layout { padding-block: 8px; }
}
@media (max-width: 760px) {
  body:has(.mc-chat-active) #launch-notice-host { max-height: min(28dvh, max(0px, calc(var(--mc-visible-viewport-height, 100dvh) - 220px))); overflow-y: auto; overscroll-behavior: contain; }
  #main .messages-view .message-footer .message-report { opacity: 1; }
}
.messages-view .mc-composer-shell { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; max-height: calc(100% - 65px); }
.messages-view .mc-composer:not(.has-voice-draft) { display: flex; flex-direction: column; align-items: stretch; flex: 0 0 auto; min-height: 54px; max-height: max(54px, calc(var(--mc-surface-height, 100dvh) - 65px)); overflow-y: auto; overscroll-behavior: contain; }
.messages-view .mc-composer:not(.has-voice-draft) > .mc-compose-line { flex: none; width: 100%; position: sticky; bottom: 0; z-index: 2; background: var(--mc-paper); }
.messages-view .mc-composer-shell:has(.mc-inline-dock:not([hidden])) .mc-composer:not(.has-voice-draft) { max-height: max(54px, calc(var(--mc-surface-height, 100dvh) - 137px)); }
.messages-view .mc-composer-shell:has(.mc-inline-dock:not([hidden])) .mc-compose-line textarea { max-height: 42px; }
.messages-view .mc-composer:not(.has-voice-draft) > .mc-error { order: -1; }
.messages-view .mc-composer .mc-error:empty { display: none; }
.messages-view .mc-compose-line textarea { max-height: min(116px, max(42px, calc(var(--mc-surface-height, 100dvh) - 150px))); }
.messages-view .mc-inline-dock { flex: 0 1 auto; min-height: 0; max-height: min(42dvh, max(48px, calc(var(--mc-surface-height, 100dvh) - 112px))); scrollbar-width: thin; }
.messages-view .mc-inline-dock .mc-dock-top { position: sticky; top: -7px; z-index: 3; height: auto; min-height: 32px; color: #465f4d; background: #f6f8f1; }
#main .messages-view .mc-dock-top .mc-icon-button { width: 32px; min-width: 32px; height: 32px; min-height: 32px; max-height: 32px; padding: 7px; margin-block: 0; }
.messages-view .mc-inline-dock.mc-strip { position: relative; padding: 6px 44px 6px 8px; }
.messages-view .mc-inline-dock.mc-strip .mc-dock-top { position: absolute; top: 6px; right: 6px; padding: 0; }
.messages-view .mc-compose-line .mc-icon-button,
.messages-view .thread-list-tools :is(.mc-icon-button, .btn),
.messages-view .mc-chat-menu summary,
.messages-view .mc-dock-top .mc-icon-button { color: #284f3d; background: #edf3ef; border: 1px solid #9bab9f; }
.messages-view .mc-compose-line .mc-icon-button:hover,
.messages-view .mc-chat-menu summary:hover { background: #dde9e0; }
.messages-view .mc-compose-line .mc-icon-button svg,
.messages-view .mc-dock-top .mc-icon-button svg { stroke-width: 1.8; }
.messages-view .mc-voice-player :is(.mc-transcribe, .mc-voice-download) { color: #284f3d; background: #e4eee7; border: 1px solid #a0b2a5; }
.messages-view .message-bubble.outgoing :is(.mc-transcribe, .mc-voice-download) { color: #284f3d; }
.messages-view .mc-chat-menu > div { max-height: max(48px, calc(var(--mc-surface-height, 100dvh) - 74px)); overflow-y: auto; overscroll-behavior: contain; }
.messages-view .mc-queue-item:has(.mc-queue-menu[open]) { flex-wrap: wrap; }
.messages-view .mc-queue-menu[open] { width: 100%; }
.messages-view .mc-queue-menu[open] > summary { margin-left: auto; }
.messages-view .mc-queue-menu > div { position: static; min-width: 0; width: 100%; margin-top: 4px; box-shadow: none; }
.messages-view .conversation-info { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.messages-view .conversation-info > * { flex-shrink: 0; }
.messages-view .conversation-info .peer-panel-head { position: sticky; top: 0; z-index: 2; background: #fff; }
.messages-view .peer-shared-items { flex: none; overflow: visible; }
.messages-view :is(.mc-timezone, .mc-muted),
.messages-view .mc-inline-dock :is(.form-field, .mc-queue-content .mc-muted) { color: #465f4d; }
/* Toasts contain text only. They must not intercept a recording gesture. */
body:has(.messages-view) #toast { pointer-events: none; bottom: auto; top: 12px; max-height: min(25dvh, 130px); overflow: auto; }

/* Video previews get their own space; the controls always retain a full row. */
.messages-view .mc-composer-shell.is-recording .mc-composer { min-height: 0; }
.messages-view .mc-composer:has(.mc-draft-video) > .mc-draft-attachments { flex: 0 1 auto; min-height: 0; max-height: none; }
.messages-view .mc-composer:has(.mc-draft-video) { flex: 0 1 auto; min-height: 54px; }
.messages-view .mc-draft-video { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
.messages-view .mc-draft-video > .mc-draft-mark { display: none; }
.messages-view .mc-draft-video > div { grid-column: 1; }
.messages-view .mc-draft-video > [data-mc-remove] { align-self: start; grid-column: 2; grid-row: 1; }
.messages-view .mc-draft-video video { margin: 6px auto 0; width: min(264px, 100%, max(64px, calc(var(--mc-surface-height, 600px) - 202px))); height: auto; max-width: 264px; max-height: none; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.messages-view .mc-submit-state { display: flex; align-items: center; gap: 5px; grid-column: 1/-1; font-size: 11px; line-height: 20px; }
.messages-view .mc-submit-state[hidden] { display: none; }
.messages-view .message-receipt[data-receipt-state="error"] { color: #a24239; }
@media (min-width: 761px) and (max-height: 450px) {
  body:has(.messages-view) .topbar-inner { min-height: 54px; padding-block: 5px; }
  body:has(.messages-view) .brand img { height: 40px; }
  body:has(.messages-view) #launch-notice-host { max-height: min(26dvh, max(0px, calc(100dvh - 240px))); }
}

/* One control vocabulary: quiet stroke icons, 40px compose / 32px media. */
.messages-view :is(button, input, textarea, summary) { font-family: inherit; }
.messages-view .thread-list-head { min-height: 64px; padding: 14px 15px 7px; }
.messages-view .thread-list-head h1 { font-size: 18px; }
.messages-view .thread-search { min-height: 42px; margin: 4px 14px 10px; padding: 9px 11px; border-radius: 9px; background: #f2f4f2; }
.messages-view .thread-search input { font-size: 14px; }
.messages-view .thread-title-line strong { font-weight: 600; }
.messages-view .thread-preview-line { gap: 7px; }
.messages-view .thread-privacy { min-height: 47px; padding: 12px 15px; border-top: 1px solid #edf0ed; font-size: 12px; }
.messages-view .thread-unread { min-width: 22px; height: 22px; border-radius: 11px; font-size: 11px; }
.messages-view .conversation-head { gap: 12px; padding-inline: 16px; }
.messages-view .conversation-peer h2 { font-size: 15px; font-weight: 600; }
.messages-view .conversation-peer > span { font-size: 12px; }
.messages-view .conversation-history { padding: 16px 22px; }
.messages-view .message-footer time { font-size: 11px; }
.messages-view .mc-composer.message-reply-form { padding: 8px 12px; }
.messages-view .mc-composer:not(.has-voice-draft) > .mc-compose-line { align-items: center; gap: 3px; padding: 3px; border: 1px solid #e1e7e2; border-radius: 11px; }
.messages-view .mc-compose-line textarea { padding: 10px 8px; border: 0; background: #fff; font-size: 15px; }
.messages-view .mc-compose-line textarea:focus { outline-offset: -2px; }
.messages-view .mc-icon-button,
.messages-view .mc-chat-menu summary,
.messages-view .mc-record-controls .mc-icon-button { border-radius: 8px; }
.messages-view .mc-compose-line .mc-icon-button,
.messages-view .thread-list-tools :is(.mc-icon-button, .btn),
.messages-view .mc-chat-menu summary,
.messages-view .mc-dock-top .mc-icon-button,
.messages-view .mc-record-controls .mc-icon-button { color: #52675b; background: transparent; border: 0; }
.messages-view .mc-compose-line .mc-icon-button:hover,
.messages-view .thread-list-tools :is(.mc-icon-button, .btn):hover,
.messages-view .mc-chat-menu summary:hover,
.messages-view .mc-dock-top .mc-icon-button:hover,
.messages-view .mc-record-controls .mc-icon-button:hover { color: #285d4b; background: #eef2ef; }
.messages-view .mc-compose-line .mc-send-control .mc-record-button { color: #52675b; background: transparent; }
.messages-view .mc-compose-line .mc-send-control .mc-record-button:hover { background: #eef2ef; }
.messages-view .mc-compose-line .mc-send-control .mc-send-button { background: #285d4b; color: #fff; }
.messages-view .mc-compose-line .mc-send-control .mc-send-button:hover { background: #1c513c; }
.messages-view :is(.mc-icon-button, .mc-chat-menu summary, .mc-record-button, .mc-send-button, .mc-voice-download) svg,
body:has(.messages-view) .sidebar .nav-item > svg { stroke-width: 1.7; }
.messages-view .mc-voice-player :is(.mc-transcribe, .mc-voice-download),
.messages-view .mc-media-tools > .mc-transcribe { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 32px; min-height: 32px; padding: 5px 6px; border: 0; border-radius: 8px; background: transparent; color: #52675b; font-size: 13px; line-height: 20px; white-space: nowrap; }
#main .messages-view .mc-voice-player .mc-transcribe { width: auto; min-width: 65px; height: 32px; min-height: 32px; max-height: 32px; padding: 5px 6px; flex: 0 0 auto; }
#main .messages-view .mc-voice-player .mc-voice-download { width: 32px; min-width: 32px; height: 32px; min-height: 32px; max-height: 32px; padding: 7px; flex: 0 0 32px; }
.messages-view .mc-transcribe svg { width: 16px; height: 16px; fill: none; stroke-width: 1.7; }
.messages-view .mc-transcribe > span { font-size: 13px; line-height: 20px; }
.messages-view .mc-voice-player :is(.mc-transcribe, .mc-voice-download):hover,
.messages-view .mc-media-tools > .mc-transcribe:hover,
.messages-view .mc-transcribe[aria-expanded="true"] { color: #285d4b; background: #e3ece5; }
.messages-view .mc-transcript-state[hidden] { display: none; }
.messages-view .mc-voice-player .mc-voice-play,
.messages-view .message-bubble.outgoing .mc-voice-play { border-radius: 8px; background: transparent; color: #285d4b; }
.messages-view .mc-voice-player .mc-voice-play:hover { background: #e3ece5; }
.messages-view .mc-voice-time { font-size: 11px; }
.messages-view .message-bubble.is-voice .mc-voice-timeline { min-width: 30px; }
.messages-view .message-bubble.is-voice .message-footer time { font-size: 10px; }
.messages-view .mc-transcript,
.messages-view .mc-transcript :is(p, .mc-muted) { font-size: 14px; line-height: 1.65; }
.messages-view .mc-transcript button { min-height: 32px; font-size: 13px; border-radius: 8px; }
@media (max-width: 760px) {
  .messages-view .thread-search input { font-size: 16px; }
  .messages-view .conversation-head { padding-inline: 6px 10px; gap: 8px; }
  .messages-view .conversation-history { padding: 12px 9px; }
  .messages-view .mc-composer.message-reply-form { padding: 6px; }
  .messages-view .mc-compose-line textarea { font-size: 16px; }
  .messages-view .message-bubble.is-voice { max-width: 100%; }
  .messages-view .message-bubble.is-voice .mc-voice-player { gap: 3px; }
}
/* At a 300px Windows viewport, history padding must yield before the input.
 * Keep the full control row, including its border and outer spacing, in flow. */
@media (min-width: 761px) and (max-height: 360px) {
  .messages-view .conversation-head { flex: 0 0 auto; min-height: 48px; padding-block: 5px; }
  .messages-view .conversation-head > .avatar { width: 32px; height: 32px; }
  .messages-view .conversation-history { flex: 1 1 0%; padding-block: 4px; }
  .messages-view .mc-composer-shell { flex-shrink: 0; max-height: calc(100% - 48px); }
  .messages-view .mc-composer.message-reply-form { padding-block: 6px; }
}

/* Keep the circle's picture separate from controls; never crop native buttons. */
.messages-view .mc-video-player { width: min(264px, 100%); min-width: 0; margin: 6px auto 0; }
.messages-view .mc-video-player[data-video-round="false"] { width: min(420px, 100%); }
.messages-view .mc-video-player > video,
.messages-view .mc-draft-video .mc-video-player > video { display: block; width: 100%; max-width: 100%; height: auto; margin: 0; border-radius: 12px; background: #192c21; object-fit: contain; }
.messages-view .mc-video-player[data-video-round="true"] > video { aspect-ratio: 1; object-fit: cover; }
.messages-view .mc-video-player.is-enhanced[data-video-round="true"] > video { border-radius: 50%; }
.messages-view .mc-draft-video .mc-video-player.is-enhanced > video { width: min(264px, 100%, max(64px, calc(var(--mc-surface-height, 600px) - 252px))); margin-inline: auto; }
.messages-view .mc-video-controls { display: grid; grid-template-columns: 44px minmax(24px, 1fr) auto 40px 44px; align-items: center; gap: 2px; margin-top: 6px; border-radius: 10px; background: #e8f0e9; color: #285d4b; }
.messages-view .mc-video-controls[hidden],.messages-view .mc-video-error[hidden] { display: none; }
.messages-view .mc-video-controls button { display: grid; place-items: center; box-sizing: border-box; min-width: 0; width: 100%; min-height: 44px; height: 44px; padding: 9px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.messages-view .mc-video-controls button:hover { background: #d9e7dd; }
.messages-view .mc-video-controls button:focus-visible,.messages-view .mc-video-controls input:focus-visible { outline: 2px solid #285d4b; outline-offset: 2px; }
.messages-view .mc-video-controls svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.messages-view .mc-video-controls input[type="range"] { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; height: 44px; padding: 0; margin: 0; accent-color: #285d4b; cursor: pointer; }
.messages-view .mc-video-controls [data-video-time] { display: block; width: auto; margin: 0; font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.messages-view .mc-video-error { margin: 6px 0; font-size: 13px; line-height: 1.5; color: #8b3131; }
.messages-view .mc-video-player.is-enhanced > video:fullscreen { width: 100%; height: 100%; border-radius: 0; object-fit: contain; }
/* A shallow desktop window has room for either a draft or the input, not both
 * in flow. Float the bounded preview above the input so its controls stay usable. */
@media (min-width: 761px) and (max-height: 360px) {
  .messages-view .mc-composer:has(.mc-draft-video) > .mc-draft-attachments {
    position: absolute; bottom: calc(100% + 6px); right: 8px;
    width: min(320px, calc(100% - 16px)); max-height: calc(100dvh - 90px);
    padding: 5px; overflow-y: auto; background: var(--mc-paper);
    border: 1px solid var(--mc-line); border-radius: 12px;
    box-shadow: 0 4px 18px #20372d24;
  }
  .messages-view .mc-draft-video > div > :is(strong, span) { display: none; }
  .messages-view .mc-draft-video .mc-video-player { margin-top: 0; }
  .messages-view .mc-draft-video .mc-video-player > video:not(:fullscreen) { width: 0; height: 0; visibility: hidden; }
  .messages-view .mc-draft-video .mc-video-controls { margin-top: 0; }
}
