/* Only the painted marks shrink; the playback and reveal targets keep their touch size. */
:root {
  --chat-mark-scale: .8;
  --chat-mark-height: calc(var(--chat-mark-scale) * max(24px, var(--ds-fs-micro) + 8px));
  --chat-mark-width: calc(var(--chat-mark-scale) * max(36px, var(--ds-fs-micro) * 2.4 + 5px));
  --chat-mark-font: max(10px, calc(var(--chat-mark-scale) * var(--ds-fs-micro)));
  --chat-mark-icon: calc(var(--chat-mark-scale) * clamp(16px, 1rem, 20px));
  --chat-seal-size: calc(var(--chat-mark-scale) * 34px);
  --chat-seal-gap: 7px;
  --chat-mark-control: max(var(--ds-touch), var(--chat-mark-height));
  --chat-mark-gap: 4px;
  --chat-mark-inset: 6px;
  --chat-mark-radius: var(--ds-radius-sm);
  --chat-mark-opacity: .67;
  --chat-mark-neutral: #15131c;
  --chat-circle-progress: #4ca7ff;
}
.chat-media-marks {
  position: absolute; z-index: 3; inset: var(--chat-mark-inset) var(--chat-mark-inset) auto auto;
  display: flex; align-items: center; gap: var(--chat-mark-gap); pointer-events: none;
}
.chat-media-marks[hidden] { display: none; }
/* The private player still uses a flow row; the transcript anchors this strip. */
.chat-mark-row { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; max-inline-size: 100%; }
.chat-mark-row > .chat-content-age { pointer-events: none; }
.chat-mark-row .chat-media-hide { --chat-mark-fill: #151515; }
.chat-content-age, .chat-lc-media-type {
  box-sizing: border-box; min-block-size: var(--chat-mark-height);
  border-radius: var(--chat-mark-radius); color: white;
}
.chat-content-age {
  display: inline-grid; place-items: center; flex: none; inline-size: var(--chat-mark-width); padding: 0;
  background: var(--ds-danger); color: var(--ds-on-danger); font: 750 var(--chat-mark-font)/1 var(--lc-font); white-space: nowrap;
}
:is(.chat-media-fullscreen, .chat-media-hide, .chat-lc-speed) {
  position: relative; display: inline-grid; place-items: center; flex: none; box-sizing: border-box;
  margin: 0; padding: 0; border: 0; border-radius: var(--chat-mark-radius);
  color: white; pointer-events: auto; cursor: pointer;
}
.chat-media-fullscreen { inline-size: var(--ds-touch); block-size: var(--ds-touch); background: none; }
.chat-media-fullscreen .lc-icon { inline-size: var(--chat-mark-icon); block-size: var(--chat-mark-icon); filter: drop-shadow(0 1px 2px #15131c); }
:is(.chat-media-hide, .chat-lc-speed) {
  inline-size: max(var(--ds-touch), var(--chat-mark-width)); block-size: var(--chat-mark-control);
  isolation: isolate; background: transparent;
}
:is(.chat-media-hide, .chat-lc-speed)::before {
  content: ''; position: absolute; z-index: -1; border-radius: inherit; pointer-events: none;
  inline-size: var(--chat-mark-width); block-size: var(--chat-mark-height); background: var(--chat-mark-fill);
}
.chat-media-hide { --chat-mark-fill: rgb(11 15 23 / .82); }
.chat-media-hide .lc-icon { inline-size: var(--chat-mark-icon); block-size: var(--chat-mark-icon); }
.chat-lc-speed { --chat-mark-fill: #64c1ff; color: #0c2035; font: 750 var(--chat-mark-font)/1 var(--lc-font); white-space: nowrap; }
:where(html:not([data-lc-pointer-input])) .chat-media-fullscreen:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
:is(.chat-media-hide, .chat-lc-speed):focus { outline: none; }
:where(html:not([data-lc-pointer-input])) :is(.chat-media-hide, .chat-lc-speed):focus-visible {
  --chat-mark-fill: var(--ds-focus-fill);
  color: var(--ds-focus-ink);
  forced-color-adjust: none;
}
:is(.chat-lc-visual, .chat-link-head, .chat-age-spoiler)[tabindex="-1"]:focus { outline: none; }
.chat-lc-visual-item, .chat-lc-circle { position: relative; min-inline-size: 0; min-block-size: 0; }
.chat-lc-visual-item > .chat-media-fullscreen { position: absolute; z-index: 2; inset: 0 0 auto auto; }
:is(.chat-media-fullscreen, .chat-media-hide, .chat-content-age, .chat-lc-speed)[hidden] { display: none; }
@media (forced-colors: active) {
  :is(.chat-content-age, .chat-media-fullscreen, .chat-lc-media-type) { border: 1px solid ButtonText; }
  :is(.chat-media-hide, .chat-lc-speed)::before { box-sizing: border-box; border: 1px solid ButtonText; }
  :root { --chat-mark-opacity: 1; }
}
.chat-lc-media-type {
  top: var(--chat-mark-inset); left: var(--chat-mark-inset); gap: 4px; padding: 0 5px;
  font-size: var(--chat-mark-font); background: var(--chat-mark-neutral); opacity: var(--chat-mark-opacity);
}
.chat-lc-media-type .lc-icon { inline-size: calc(var(--chat-mark-scale) * 12px); block-size: calc(var(--chat-mark-scale) * 12px); }
.chat-lc-file-badge {
  box-sizing: border-box; min-block-size: var(--chat-mark-height); padding: 0 5px;
  background: var(--chat-mark-neutral); color: white; font: 500 var(--chat-mark-font)/1 var(--lc-font); opacity: var(--chat-mark-opacity);
}
.chat-viewer-media { position: relative; }
.chat-viewer-media > :is(img, video) { display: block; }

/* Repeatable and 1× covers share the treatment, never the icon or action. */
.chat-seal-glyph {
  position: relative; z-index: 1; display: grid; place-items: center; flex: none;
  box-sizing: border-box; inline-size: var(--chat-seal-size); block-size: var(--chat-seal-size);
  border-radius: 50%; background: rgb(0 0 0 / .48); color: #fff;
}
.chat-seal-glyph .lc-icon { inline-size: calc(var(--chat-mark-scale) * 27px); block-size: calc(var(--chat-mark-scale) * 27px); }
.chat-seal-label { font: 750 var(--ds-fs-body)/1.15 var(--lc-font); letter-spacing: .01em; text-shadow: 0 1px 6px #121212; }
@media (forced-colors: active) { .chat-seal-glyph { border: 1px solid ButtonText; } }
#chat-1x1-messages [data-file-pending] :is(.chat-spoiler-eye, .chat-link-reveal-copy) { visibility: hidden; }
.chat-lc-sealed > .chat-once-cover-copy { position: relative; }
/* Sealed 1× geometry is public layout only. The dust is generated here, never from a poster. */
#chat-1x1-messages .chat-lc-sealed:is([data-cover="photo"],[data-cover="video"],[data-cover="album"]),
#chat-1x1-messages .chat-lc-media:is(.chat-lc-media--photo,.chat-lc-media--video) .chat-lc-file {
  inline-size: min(280px, 70vw, calc(340px * var(--chat-fit-ratio, 1.6))); min-inline-size: 0;
  aspect-ratio: var(--chat-fit-ratio, 1.6); block-size: auto;
}
#chat-1x1-messages .chat-lc-sealed[data-cover="photo"], #chat-1x1-messages .chat-lc-media--photo .chat-lc-file { --chat-fit-ratio: 1.3333; }
#chat-1x1-messages .chat-lc-sealed[data-cover="album"] { --chat-fit-ratio: 2; }
#chat-1x1-messages .chat-lc-bubble:has(> :is(.chat-lc-once-frame, .chat-lc-text-seal)) { padding: 0; background: none; border-radius: var(--ds-radius-lg); }
#chat-1x1-messages .chat-once-cover.chat-lc-sealed {
  isolation: isolate; overflow: hidden; padding: 6px; gap: 5px; box-sizing: border-box; align-content: center;
  color: #f6f6f6; letter-spacing: .01em;
}
#chat-1x1-messages .chat-once-cover[data-cover="text"] {
  --chat-text-rows: 1;
  inline-size: min(calc(155px + var(--chat-text-rows) * 22px), 70vw);
  min-block-size: calc(65px + (var(--chat-text-rows) - 1) * 17px); aspect-ratio: auto;
  border-radius: var(--ds-radius-xl);
  display: flex; justify-content: flex-start; text-align: start; padding-inline: 10px; gap: 8px;
}
.chat-once-age { position: absolute; z-index: 2; inset: var(--chat-mark-inset) var(--chat-mark-inset) auto auto; pointer-events: none; }
.chat-lc-circle-tile .chat-once-age { inset-inline-end: 22%; }
.chat-once-cover[data-cover="text"] .chat-once-age {
  inset: var(--chat-mark-inset) auto auto var(--chat-mark-inset);
}
#chat-1x1-messages .chat-lc-text-seal > .chat-once-cover[data-cover="text"] {
  padding-block-end: calc(var(--chat-stamp-room) + 6px);
}
#chat-1x1-messages .chat-lc-text-seal > .chat-once-cover[data-once-adult][data-cover="text"] {
  padding-block-start: calc(var(--chat-mark-height) + var(--chat-mark-inset) + 3px);
}
.chat-once-cover:disabled { opacity: 1; cursor: default; }
.chat-once-cover-copy { z-index: 1; display: grid; gap: 3px; min-inline-size: 0; overflow-wrap: anywhere; line-height: 1.15; text-shadow: 0 1px 6px #121212; }
.chat-once-cover-copy strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-once-cover-copy small { font-size: var(--ds-fs-micro); color: #eaeaea; }
.chat-playback-progress { display: flex; align-items: center; gap: 9px; max-width: 100%; width: min(420px, 100%); color: inherit; }
.chat-playback-progress[hidden] { display: none; }
.chat-playback-progress input { flex: 1; min-width: 0; min-height: 32px; accent-color: var(--lc-accent); }
.chat-playback-progress span { font-size: var(--ds-fs-label); white-space: nowrap; font-variant-numeric: tabular-nums; }
#chat-1x1-viewer-body:has(.chat-playback-progress:not([hidden])) { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
#chat-1x1-messages .chat-lc-bubble:has(> :is(.chat-lc-visual, .chat-lc-once-frame)) {
  display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 4px;
}
#chat-1x1-messages .chat-lc-visual { align-self: stretch; min-inline-size: 0; border-radius: var(--ds-radius-lg); }
#chat-1x1-messages .chat-lc-visual > .chat-lc-media { margin: 0; }
/* Bare tiles and 1× covers have no bubble padding. Short/narrow tiles, replies
   and edit marks keep the stamp in flow instead of covering the artwork. */
#chat-1x1-messages :is([data-media-only] > .chat-lc-bubble, .chat-lc-bubble:has(> .chat-lc-once-frame)) > .chat-lc-meta {
  margin-inline-end: var(--chat-stamp-end);
  margin-block-end: var(--chat-stamp-bottom);
}
#chat-1x1-messages :is([data-media-only] > .chat-lc-bubble, .chat-lc-bubble:has(> .chat-lc-once-frame)):has(> [data-stamp-overlay]):not(:has(> .chat-lc-quote, .chat-lc-edited)) > .chat-lc-meta {
  /* Overlay the tile's grid area, not the start or end of the transcript row. */
  position: absolute; z-index: 4; grid-area: 1 / 1 / 2 / 2;
  inset-block: auto var(--chat-stamp-bottom); inset-inline: auto var(--chat-stamp-end);
  box-sizing: border-box; min-block-size: calc(var(--chat-stamp-height) + 6px);
  max-inline-size: calc(100% - 2 * var(--chat-stamp-end)); margin: 0;
  padding: 3px 7px; border-radius: 999px; color: #fff; background: var(--chat-mark-neutral);
}
#chat-1x1-messages .chat-lc-bubble:has(> .chat-lc-circle-tile) { --chat-stamp-bottom: 4px; }
.chat-lc-visual > .chat-media-marks {
  inset-inline-end: var(--chat-stamp-end);
  flex-wrap: wrap; justify-content: flex-end; max-inline-size: calc(100% - 2 * var(--chat-stamp-end));
}
.chat-lc-visual[data-visual-spoiler="album"] > .chat-lc-media-type { z-index: 2; }
.chat-lc-visual[data-visual-spoiler="album"] > .chat-media-marks {
  align-items: flex-start; inset-inline-end: var(--chat-mark-inset);
}
/* The compact face is flush with the actual corner, not centered in the
   touch target or on the inset badge row. Only the target extends inward. */
.chat-lc-visual[data-visual-spoiler="album"].chat-lc-spoiler--opened > .chat-media-marks {
  inset: 0 0 auto auto;
  flex-wrap: nowrap;
  max-inline-size: 100%;
}
.chat-lc-visual[data-visual-spoiler="album"].chat-lc-spoiler--opened > .chat-media-marks > .chat-content-age {
  margin-block-start: var(--chat-mark-inset);
}
.chat-lc-visual[data-visual-spoiler="album"] > .chat-media-marks > .chat-media-hide {
  --chat-mark-width: var(--chat-mark-height);
  grid-template: var(--chat-mark-height) 1fr / 1fr var(--chat-mark-width);
}
.chat-lc-visual[data-visual-spoiler="album"] > .chat-media-marks > .chat-media-hide > .lc-icon,
.chat-lc-visual[data-visual-spoiler="album"] > .chat-media-marks > .chat-media-hide::before { grid-area: 1 / 2; }
.chat-lc-visual[data-visual-spoiler="album"] > .chat-media-marks > .chat-media-hide::before {
  position: static;
  border-start-end-radius: var(--ds-radius-lg);
}
/* The square is the positioning box. Only the video and cover are clipped to a circle;
   duration stays at bottom left, with the sent stamp at bottom right. */
#chat-1x1-messages .chat-lc-visual.chat-lc-circle-tile {
  position: relative; flex: none; max-inline-size: 100%; container: chat-circle / inline-size;
  inline-size: var(--chat-tile-width, min(304px, 71vw, var(--chat-circle-room, 304px)));
  aspect-ratio: 1; grid-template: minmax(0, 1fr) / minmax(0, 1fr);
}
@supports (inline-size: 1cqh) {
  #chat-1x1-messages { container-type: size; }
  #chat-1x1-messages .chat-lc-circle-tile { --chat-circle-room: max(var(--ds-touch), calc(100cqh - 8px)); }
}
#chat-1x1-messages .chat-lc-visual[data-visual-spoiler="circle"] {
  --chat-tile-width: min(234px, 54.67vw, var(--chat-circle-room, 304px));
  transition: inline-size var(--ds-dur) var(--ds-ease-out);
}
#chat-1x1-messages .chat-lc-visual[data-visual-spoiler="circle"][data-circle-playing] { --chat-tile-width: min(304px, 71vw, var(--chat-circle-room, 304px)); }
@media (prefers-reduced-motion: reduce) {
  #chat-1x1-messages .chat-lc-visual[data-visual-spoiler="circle"] { transition: none; }
}
html[data-hub-motion="reduced"] #chat-1x1-messages .chat-lc-visual[data-visual-spoiler="circle"] { transition: none; }
#chat-1x1-messages .chat-lc-circle-tile > :is(.chat-lc-sealed, .chat-lc-media),
#chat-1x1-messages .chat-lc-circle-tile .chat-lc-circle {
  inline-size: 100%; block-size: 100%; max-inline-size: none; max-block-size: none;
}
#chat-1x1-messages .chat-lc-circle-tile .chat-lc-media { overflow: visible; }
#chat-1x1-messages .chat-lc-circle-tile > .chat-lc-circle-info {
  position: absolute; z-index: 2; inset: auto auto 4px 8px;
  display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px; border-radius: 999px;
  color: #fff; background: var(--chat-mark-neutral); opacity: var(--chat-mark-opacity);
  font: 400 var(--ds-fs-micro)/1 var(--lc-font); font-variant-numeric: tabular-nums; pointer-events: none;
}
/* Short scrollports can leave less room than two clocks side by side. Keep
   the sent stamp in its corner; lift duration above it instead of shrinking text. */
@container chat-circle (inline-size < calc(4.5rem + 44px)) {
  #chat-1x1-messages .chat-lc-circle-tile > .chat-lc-circle-info {
    inset-block-end: calc(var(--chat-stamp-bottom) + var(--chat-stamp-height) + 10px);
  }
}
#chat-1x1-messages .chat-lc-circle-tile > .chat-lc-circle-info[hidden] { display: none; }
.chat-lc-circle-info i { inline-size: .5em; block-size: .5em; border-radius: 50%; background: currentColor; }
.chat-lc-circle-tile > .chat-media-marks { inset-inline-end: calc(var(--chat-stamp-end) + 16px); }
#chat-1x1-messages .chat-bubble:has(.chat-lc-circle-tile) { margin-block: 1px; }
.chat-circle-stage { position: relative; inline-size: 100%; block-size: 100%; }
.chat-circle-surface {
  position: absolute; inset: 0; border: 0; padding: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
.chat-circle-surface:focus-visible {
  outline: var(--ds-focus-ring); outline-offset: -3px; border-radius: 50%;
}
.chat-lc-ring .chat-lc-ring-hit { stroke: transparent; stroke-width: 13px; }
.chat-lc-ring[data-seekable] .chat-lc-ring-hit { pointer-events: stroke; cursor: crosshair; }
/* Focus is drawn on the circular SVG track, rather than as a square UA outline. */
.chat-lc-ring[role="slider"]:focus { outline: none; }
.chat-lc-ring[role="slider"]:focus-visible > circle:first-child { stroke: #fff; stroke-width: 1.7; }
@media (forced-colors: active) {
  .chat-lc-ring[role="slider"]:focus-visible > circle:first-child { stroke: Highlight; }
}
.chat-circle-surface:not([aria-pressed="true"])::after {
  content: "";
  pointer-events: none;
  position: absolute; inset: 50% auto auto 50%; translate: -50% -50%;
  inline-size: 15px; block-size: 18px; clip-path: polygon(10% 0, 100% 50%, 10% 100%); background: white;
}
.chat-circle-surface:not([aria-pressed="true"]) { background: radial-gradient(circle closest-side at center, rgb(11 15 23 / .83) 22px, transparent 23px); }
/* The same audio face dimensions apply before/after reveal. The overlay itself
   takes no track: reserve a side lane, or a top band when large type needs it. */
#chat-1x1-messages .chat-bubble:is([data-media="voice"], [data-media="music"]) > .chat-lc-bubble {
  box-sizing: border-box; inline-size: min(308px, 100%); max-inline-size: 100%; container: chat-audio / inline-size;
  --chat-audio-action-width: max(var(--ds-touch), var(--chat-mark-width));
  --chat-audio-actions: var(--chat-audio-action-width);
  padding: 8px; gap: 3px 6px;
}
#chat-1x1-messages .chat-bubble[data-chat-adult] > .chat-lc-bubble {
  --chat-audio-actions: calc(2 * var(--chat-audio-action-width) + var(--chat-mark-width) + 4px);
}
.chat-lc-audio-receipt { flex: 1 1 100%; }
/* Closed audio has one skin for the whole bubble, including its sent stamp.
   Leave the disclosure button and the open player's footprint unchanged between states. */
#chat-1x1-messages .chat-lc-bubble:has(> :is(.chat-lc-audio-receipt, .chat-age-spoiler[data-audio]:not([data-age-open]))) {
  position: relative; isolation: isolate; color: #fff; background: #171717;
}
#chat-1x1-messages .chat-lc-bubble:has(> .chat-age-spoiler[data-audio]:not([data-age-open])) :is(.chat-lc-quote, .chat-lc-quote-words > *) { color: inherit; }
#chat-1x1-messages .chat-lc-bubble:has(> :is(.chat-lc-audio-receipt, .chat-age-spoiler[data-audio]) > .chat-audio-seal:focus-visible),
#chat-1x1-messages .chat-bubble.is-picked > .chat-lc-bubble:has(> :is(.chat-lc-audio-receipt, .chat-age-spoiler[data-audio]:not([data-age-open]))) {
  outline: 2px solid var(--ds-ink);
}
#chat-1x1-messages .chat-audio-seal:focus-visible { outline: none; }
#chat-1x1-messages :is(.chat-lc-audio-receipt, .chat-age-spoiler[data-audio]:not([data-age-open])) {
  position: static; isolation: auto; border-radius: inherit;
}
:is(.chat-lc-audio-receipt, .chat-age-spoiler[data-audio]) > .chat-veil-skin { z-index: -1; }
:is(.chat-lc-voice-card, .chat-audio-seal, .chat-lc-music) {
  --chat-audio-wave: 24px;
  --chat-audio-clock: calc(1.25 * var(--ds-fs-micro) + 1px);
  --chat-audio-line: var(--chat-mark-control);
}
.chat-lc-voice-card {
  display: grid; grid-template: 'play wave' var(--chat-audio-wave) 'play line' auto / var(--ds-touch) minmax(0, 1fr);
  align-items: center; column-gap: 8px; min-inline-size: 0;
}
.chat-lc-voice-card > .chat-lc-play { grid-area: play; inline-size: var(--ds-touch); block-size: var(--ds-touch); }
.chat-lc-voice-card > .chat-lc-wave { grid-area: wave; block-size: 100%; gap: 1.5px; }
.chat-lc-voice-card > .chat-lc-wave > span { min-inline-size: 0; }
.chat-lc-voice-card > .chat-lc-wave:not([data-seek]) { cursor: default; }
.chat-lc-voice-card > .chat-lc-voice-line { grid-area: line; }
.chat-lc-voice-line {
  display: flex; align-items: center; justify-content: space-between; gap: 0 2px; flex-wrap: wrap;
  min-block-size: var(--chat-audio-line); font: 600 var(--ds-fs-micro)/1.25 var(--lc-font); font-variant-numeric: tabular-nums;
}
.chat-lc-voice-line > span { color: var(--lc-muted); white-space: nowrap; }
.chat-lc-voice-line .chat-mark-row { margin-inline-start: auto; justify-content: flex-end; }
@container chat-audio (min-width: 0px) {
  :is(.chat-lc-voice-card, .chat-lc-music, .chat-audio-seal) {
    /* End the wave row where a full-height bar centered on Play ends. */
    --chat-audio-head: calc((var(--ds-touch) + var(--chat-audio-wave)) / 2);
    --chat-audio-line: max(var(--chat-audio-clock), var(--ds-touch) - var(--chat-audio-head));
    --chat-audio-rail-height: var(--chat-mark-control);
    --chat-audio-end: calc(var(--chat-audio-actions) + 6px);
    --chat-audio-start: 0px;
    --chat-audio-face-height: max(var(--chat-audio-rail-height), calc(var(--chat-audio-start) + var(--chat-audio-head) + var(--chat-audio-line)));
    position: relative; box-sizing: border-box; align-content: start; min-inline-size: 0;
    min-block-size: var(--chat-audio-face-height);
    padding: var(--chat-audio-start) var(--chat-audio-end) 0 0;
  }
  .chat-lc-voice-card {
    grid-template: 'play wave' var(--chat-audio-head) 'play line' var(--chat-audio-line) / var(--ds-touch) minmax(0, 1fr);
    column-gap: 8px;
  }
  .chat-lc-music {
    grid-template: 'play about' var(--chat-audio-head) 'play line' var(--chat-audio-line) / var(--ds-touch) minmax(0,1fr);
    gap: 0 8px;
  }
  .chat-lc-music-about { grid-area: about; }
  .chat-lc-music > .chat-lc-play { grid-area: play; align-self: start; }
  .chat-lc-music .chat-lc-voice-line { grid-area: line; align-self: start; min-block-size: 0; }
  .chat-lc-voice-card > .chat-lc-play { align-self: start; }
  .chat-lc-voice-card > .chat-lc-wave { align-self: end; block-size: var(--chat-audio-wave); }
  .chat-lc-voice-card > .chat-lc-voice-line { display: contents; }
  .chat-lc-voice-card > .chat-lc-voice-line > span { grid-area: line; align-self: start; }
  :is(.chat-lc-voice-card, .chat-lc-music) > .chat-lc-voice-line { margin-block-start: 1px; }
  :is(.chat-lc-voice-card, .chat-lc-music) .chat-mark-row {
    position: absolute; z-index: 3; inset: 0 0 auto auto;
    justify-content: flex-end; align-items: flex-start; pointer-events: none;
  }
  .chat-mark-row > :is(.chat-lc-speed, .chat-media-hide) {
    place-items: start center;
    padding-block-start: calc((var(--chat-mark-height) - var(--chat-audio-control-ink)) / 2);
  }
  .chat-mark-row > .chat-lc-speed { --chat-audio-control-ink: var(--chat-mark-font); }
  .chat-mark-row > .chat-media-hide { --chat-audio-control-ink: var(--chat-mark-icon); }
  .chat-mark-row > :is(.chat-lc-speed, .chat-media-hide)::before { inset-block-start: 0; }
  #chat-1x1-messages :is(.chat-once-cover.chat-lc-sealed, .chat-age-spoiler > .chat-link-reveal).chat-audio-seal {
    display: flex; align-items: center; justify-content: flex-start;
    inline-size: 100%; min-block-size: var(--chat-audio-face-height); aspect-ratio: auto;
    gap: var(--chat-seal-gap); text-align: start; background: transparent;
    padding: var(--chat-audio-start) var(--chat-audio-end) 0 0;
  }
  .chat-audio-seal > .chat-content-age {
    position: absolute; z-index: 2;
    inset: 0 0 auto auto;
  }
}
.chat-audio-seal .chat-once-cover-copy strong { white-space: normal; }
.chat-audio-seal .chat-once-cover-copy small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container chat-audio (width <= calc(144px + 5.4rem)) {
  :is(.chat-lc-voice-card, .chat-lc-music, .chat-audio-seal) {
    --chat-audio-start: var(--chat-audio-rail-height); --chat-audio-end: 0px;
  }
}
/* Details share the voice duration line. Large text keeps the time legible first. */
.chat-lc-music > .chat-lc-voice-line { flex-wrap: nowrap; justify-content: flex-start; gap: 6px; }
.chat-lc-music > .chat-lc-voice-line > :first-child { flex: none; }
.chat-lc-music > .chat-lc-voice-line > :nth-child(2) { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; opacity: .82; }
#chat-1x1-messages .chat-lc-visual > button:focus-visible { outline-offset: -4px; }

/* Transfers keep their indicator in the control or tile they replace. */
.chat-upload[hidden] { display: none !important; }
.chat-upload:is([data-layout="audio"],[data-layout="visual"]) {
  display: grid; place-items: center; position: absolute; inline-size: 42px; block-size: 42px; border-radius: 50%;
}
.chat-upload[data-layout="visual"] {
  z-index: 3; inset: 50% auto auto 50%; translate: -50% -50%;
  inline-size: 49px; block-size: 49px; color: #fff; background: rgb(13 12 20 / .79); pointer-events: none;
}
.chat-age-spoiler > .chat-upload { inline-size: 40px; block-size: 40px; }
/* The once cover never grows or gains another panel: the badge itself shows transfer. */
.chat-upload[data-layout="once"] {
  position: absolute; inset-block-start: 50%; inset-inline-start: 50%; translate: -50% -50%;
  inline-size: calc(var(--chat-seal-size) + 10px); block-size: calc(var(--chat-seal-size) + 10px);
  color: #ded3ff; pointer-events: none;
}
@media (forced-colors: active) { .chat-upload[data-layout="once"] { color: Highlight; } }
.chat-lc-play:has(> .chat-upload) { position: relative; }
.chat-lc-play:has(> .chat-upload:not([hidden])) { opacity: 1; cursor: progress; }
.chat-lc-play:has(> .chat-upload:not([hidden])) > .lc-icon { visibility: hidden; }
.chat-upload > svg:not(.lc-icon) { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); transform: rotate(-90deg); }
.chat-upload circle { stroke: currentColor; stroke-width: 2.8; fill: none; opacity: .24; }
.chat-upload circle + circle { stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: var(--chat-upload-offset, 70); opacity: 1; }
.chat-upload .lc-icon { width: 17px; height: 17px; }
.chat-upload[data-indeterminate] > svg:not(.lc-icon) { animation: chat-upload-spin 1s linear infinite; }
@keyframes chat-upload-spin { to { transform: rotate(270deg); } }
@media (prefers-reduced-motion: reduce) { .chat-upload[data-indeterminate] > svg:not(.lc-icon) { animation: none; } }
html[data-hub-motion="reduced"] .chat-upload[data-indeterminate] > svg:not(.lc-icon) { animation: none; }
.chat-upload[data-layout="card"] {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 9px;
  flex: 1 0 100%; min-width: min(14rem, 56vw); box-sizing: border-box; margin-block: 4px; padding: 9px;
  border-radius: 11px; background: color-mix(in srgb, var(--lc-card) 94%, var(--lc-accent)); color: var(--lc-text);
  font-size: var(--ds-fs-label); white-space: normal;
}
.chat-upload-file { grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--lc-control); color: var(--lc-accent); }
.chat-upload strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-upload-percent { color: var(--lc-muted); font-variant-numeric: tabular-nums; }
.chat-upload progress { grid-column: 2 / -1; inline-size: 100%; block-size: 5px; accent-color: var(--lc-accent); }

#chat-1x1-pollution { background: transparent; }
#chat-1x1-pollution[aria-expanded="true"] { background: var(--lc-control); }
#screen-text-chat .chat-lc-form.chat-lc-input-wrap { padding-inline-start: 1px; }
/* A plain plus with the same touch target, including on hover and press. */
#btn-text-chat-attach {
  inline-size: var(--ds-touch); block-size: var(--ds-touch); margin-inline-end: 1px;
  background: none; box-shadow: none;
}

/* Same round action surface for the composer and the recorder; keep focus outlines. */
:is(#screen-text-chat, .chat-video-editor) :where(.chat-mark-adult, .chat-once-toggle, #chat-1x1-voice-pause, #chat-1x1-circle-pause) {
  display: inline-grid; place-items: center; flex: none; inline-size: var(--ds-touch); block-size: var(--ds-touch);
  min-inline-size: var(--ds-touch); min-block-size: var(--ds-touch); box-sizing: border-box;
  padding: 0; border-radius: 50%; border: 0; background: var(--lc-control); box-shadow: 0 2px 8px rgb(0 0 0 / .2);
}
:is(#screen-text-chat, .chat-video-editor) .chat-mark-adult[aria-pressed="true"] { background: var(--ds-danger); color: var(--ds-on-danger); }
:is(#screen-text-chat, .chat-video-editor) .chat-once-toggle[aria-pressed="true"] { background: var(--lc-button); color: var(--lc-on-button); }
#screen-text-chat { --chat-send-option-gap: 6px; }
.chat-draft-options {
  position: absolute; z-index: 4; inset: auto 6px calc(100% + var(--chat-send-option-gap)) auto;
  display: grid; gap: var(--chat-send-option-gap);
}
.chat-lc-input-wrap:not([data-draft="text"]) .chat-draft-options { display: none; }
/* Scroll the tail clear of the floating buttons without growing the input area. */
#screen-text-chat:not([data-record-hold="held"], [data-record-hold="cancel"]):has(
  #chat-1x1-form[data-draft="text"]:not([hidden]), #chat-1x1-voice:not([hidden])
) { --chat-send-options-space: calc(var(--ds-touch) + var(--chat-send-option-gap)); }
#screen-text-chat:not([data-record-hold="held"], [data-record-hold="cancel"]):has(
  #chat-1x1-form[data-draft="text"]:not([hidden]) #chat-text-once:not([hidden]),
  #chat-1x1-voice:not([hidden]) #chat-1x1-voice-once:not([hidden])
) { --chat-send-options-space: calc(2 * (var(--ds-touch) + var(--chat-send-option-gap))); }
#screen-text-chat .chat-lc-input-wrap .chat-lc-send { inline-size: var(--ds-touch); block-size: var(--ds-touch); }
#screen-text-chat :is(#btn-text-chat-attach, #chat-text-once)::after { content: none; }
.chat-lc-footer:has(.chat-lc-input-wrap[data-draft="text"]) .chat-link-hint { max-inline-size: calc(100% - 2 * (var(--ds-touch) + 7px)); }
.chat-lc-footer:has(.chat-lc-input-wrap[data-draft="text"]) .chat-lc-compose-bar { margin-inline-end: calc(var(--ds-touch) + 12px); width: auto; }
.chat-lc-record { touch-action: none; -webkit-touch-callout: none; user-select: none; }

/* The recorder itself owns the full visible screen; the chat header returns when it closes. */
#screen-text-chat:has(#chat-1x1-circle:not([hidden])) > .chat-lc-head { display: none; }
#screen-text-chat:has(#chat-1x1-circle:not([hidden])) > .chat-lc-toast {
  position: fixed; z-index: 65; top: calc(var(--app-offset-top, 0px) + max(12px, var(--ds-safe-top)));
  max-inline-size: calc(100% - 2 * max(12px, var(--ds-safe-left), var(--ds-safe-right)));
  inline-size: max-content; box-sizing: border-box; text-align: center;
}
#screen-text-chat .chat-lc-circle-rec:not([hidden]) {
  --chat-circle-inset: max(12px, var(--ds-safe-left), var(--ds-safe-right));
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; justify-content: stretch; justify-items: center;
  inset: var(--app-offset-top, 0px) 0 var(--app-bottom-gap, 0px);
  overflow: auto; gap: 8px;
  padding-block: max(16px, var(--ds-safe-top)) max(16px, var(--ds-safe-bottom));
  padding-inline: var(--chat-circle-inset);
  background: var(--lc-bg);
}
.chat-circle-camera {
  display: flex; flex-direction: column; align-items: center; align-self: stretch;
  justify-content: center; justify-content: safe center;
  inline-size: 100%; min-block-size: 0;
}
#screen-text-chat .chat-lc-circle-stage {
  /* Shrink the square vertically with the tray and hint, not just with the viewport. */
  flex: 0 1 min(max(0px, calc(100vw - 2 * var(--chat-circle-inset) - 20px)), calc(var(--app-height, 100dvh) * .49), 380px);
  inline-size: auto; max-inline-size: calc(100% - 20px); min-block-size: 0; border-radius: 50%; isolation: isolate;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  #screen-text-chat .chat-lc-circle-rec:not([hidden]) {
    background: color-mix(in srgb, var(--lc-bg) 68%, transparent);
    -webkit-backdrop-filter: var(--ds-veil-filter);
    backdrop-filter: var(--ds-veil-filter);
  }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more), (forced-colors: active) {
  #screen-text-chat .chat-lc-circle-rec:not([hidden]) {
    background: var(--lc-bg); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}
.chat-lc-circle-rec .chat-lc-ring .chat-lc-ring-on { stroke: var(--chat-circle-progress); transition: stroke-dashoffset 210ms linear; }
#screen-text-chat #chat-1x1-circle-delete { background: transparent; color: var(--lc-muted); }
.chat-circle-clock { display: inline-flex; gap: 7px; align-items: center; font-variant-numeric: tabular-nums; }
.chat-circle-clock i { width: 6px; height: 6px; border-radius: 50%; background: var(--ds-danger); }
.chat-lc-circle-rec[data-state="paused"] .chat-circle-clock i { background: var(--lc-muted); }
.chat-circle-clock .chat-lc-voice-time { min-inline-size: 0; color: var(--lc-text); font-size: var(--ds-fs-label); }
#chat-circle-gesture:not([hidden]) { inline-size: 15px; block-size: 15px; color: var(--lc-muted); }
#chat-circle-gesture[hidden] { display: none; }
/* Media send windows only. Text, links and voice keep their input stack. */
.chat-media-send-actions { display: flex; align-items: center; justify-content: center; gap: var(--ds-space-2); }
.chat-media-send-actions > button {
  flex: none; min-inline-size: max(var(--ds-touch), 2.35 * var(--ds-fs-label)); min-block-size: var(--ds-touch);
}

/* One capture tray: the centre groups can wrap without shrinking Delete, Pause or the touch targets. */
#chat-1x1-voice { position: relative; gap: 6px; padding: 5px; }
#screen-text-chat .chat-lc-circle-tools { display: grid; gap: 6px; inline-size: min(100%, 510px); }
.chat-circle-capture-controls {
  display: flex; align-items: center; gap: 4px; min-block-size: 54px;
  padding: 5px; box-sizing: border-box; border-radius: 999px; background: var(--lc-well);
}
.chat-circle-actions { flex: 1 1 auto; min-inline-size: 0; }
:is(.chat-circle-actions, .chat-circle-camera-actions, .chat-circle-send-options) {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px;
}
.chat-circle-camera-actions:not(:has(button:not([hidden]))) { display: none; }
#screen-text-chat .chat-circle-capture-controls button .lc-icon { inline-size: var(--ds-icon-sm); block-size: var(--ds-icon-sm); }
#chat-1x1-circle-torch[aria-pressed="true"] { background: var(--lc-button); color: var(--lc-on-button); }
#chat-1x1-circle-torch[aria-pressed="false"] .chat-circle-torch-rays { visibility: hidden; }
.chat-circle-camera-actions [aria-disabled="true"] { opacity: .5; cursor: wait; }
#screen-text-chat :is(.chat-lc-voice, .chat-lc-circle-tools) .chat-lc-voice-btn { flex: none; inline-size: var(--ds-touch); block-size: var(--ds-touch); }
#screen-text-chat .chat-record-meter { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-inline-size: 0; min-height: 44px; padding: 0 8px; border-radius: 999px; background: var(--lc-control); }
#screen-text-chat .chat-record-meter[hidden] { display: none; }
#screen-text-chat .chat-record-meter .chat-lc-voice-btn { inline-size: 44px; block-size: 44px; margin-inline-start: -8px; background: none; }
.chat-record-meter .chat-lc-wave { flex: 1 1 auto; min-width: 0; gap: 1px; height: 18px; }
.chat-record-meter .chat-lc-voice-time, .chat-circle-clock .chat-lc-voice-time { white-space: nowrap; font-size: var(--ds-fs-label); }
.chat-record-meter .chat-lc-wave > span { min-width: 0; }
.chat-record-options {
  position: absolute; display: grid; z-index: 4; gap: var(--chat-send-option-gap);
  inset: auto 5px calc(100% + var(--chat-send-option-gap)) auto;
}
.chat-record-once-tip {
  display: none; position: absolute; inset: 3px calc(100% + 8px) auto auto; width: min(220px, calc(100vw - 88px));
  padding: 8px 10px; box-sizing: border-box; border-radius: 11px; background: var(--lc-card);
  color: var(--lc-text); box-shadow: var(--lc-shadow-lift); font-size: var(--ds-fs-label); line-height: 1.35;
  pointer-events: none;
}
.chat-record-options .chat-once-toggle:not([hidden]):is(:focus-visible,[aria-pressed="true"]) + .chat-record-once-tip { display: block; }
/* Reserve the top row so toggling 1× doesn't move the camera. Toasts take priority there. */
.chat-lc-circle-rec > .chat-record-once-tip {
  display: block; position: static; visibility: hidden; margin: 0;
  inline-size: min(300px, 100%); text-align: center; overflow-wrap: anywhere;
}
#screen-text-chat:not(:has(> .chat-lc-toast:not([hidden])))
  .chat-lc-circle-rec:has(#chat-1x1-circle-once:not([hidden]):is(:focus-visible,[aria-pressed="true"])) > .chat-record-once-tip {
  visibility: visible;
}
.chat-record-held-icon { display: none; }
#screen-text-chat:is([data-record-hold="held"], [data-record-hold="cancel"]) :is(.chat-record-delete,.chat-record-options,.chat-lc-voice-send,.chat-circle-actions) { display: none; }
#screen-text-chat:is([data-record-hold="held"],[data-record-hold="cancel"]) .chat-record-held-icon {
  display: grid; place-items: center; flex: none; inline-size: 48px; block-size: 48px; margin-inline-start: auto;
  border-radius: 50%; color: var(--lc-on-button); background: var(--lc-button); box-shadow: none;
}
#chat-record-gesture:not([hidden]) {
  position: absolute; z-index: 65; inset: auto 64px calc(100% + 7px) auto;
  padding: 7px 11px; pointer-events: none; border-radius: 12px; background: var(--lc-card); color: var(--lc-text);
  box-shadow: var(--lc-shadow-lift); text-align: start; font-size: var(--ds-fs-label); white-space: nowrap;
}
#chat-record-gesture[data-kind="circle"]:not([hidden]) { position: fixed; inset: auto max(60px, calc((100% - 510px) / 2 + 56px)) max(108px, calc(102px + var(--ds-safe-bottom))) auto; }
.chat-record-lock {
  display: grid; place-items: center; gap: 6px; position: absolute; inset: auto -54px 0 auto;
  inline-size: 44px; padding-block: 10px; border-radius: 999px; background: var(--lc-card); color: var(--lc-muted); box-shadow: var(--lc-shadow-lift);
}
.chat-record-lock .lc-icon { inline-size: 16px; block-size: 16px; }
[data-record-hold="cancel"] #chat-record-gesture:not([hidden]) { color: var(--ds-danger); }
#screen-text-chat #chat-1x1-circle-preview { transform: none; }
#screen-text-chat #chat-1x1-circle-preview[hidden] { display: none; }
@media (max-width: 359px) {
  #screen-text-chat .chat-record-meter .chat-lc-voice-time { font-size: var(--ds-fs-micro); }
}

/* The tile owns the same box in both states, including the clock and the reveal mask. */
#chat-1x1-messages .chat-lc-visual[data-visual-spoiler] {
  flex: none; inline-size: var(--chat-tile-width, min(280px, 70vw, calc(340px * var(--chat-fit-ratio))));
  max-inline-size: 100%; aspect-ratio: var(--chat-fit-ratio); container-type: inline-size; grid-template: minmax(0, 1fr) / minmax(0, 1fr);
}
#chat-1x1-messages .chat-lc-visual[data-visual-spoiler] > :is(.chat-lc-sealed, .chat-lc-media),
#chat-1x1-messages .chat-lc-visual[data-visual-spoiler] :is(.chat-lc-file, .chat-lc-circle) {
  inline-size: 100%; block-size: 100%; min-inline-size: 0; min-block-size: 0; max-inline-size: none; max-block-size: none;
}
#chat-1x1-messages .chat-lc-visual[data-visual-spoiler="album"] .chat-lc-media {
  grid-template-rows: repeat(var(--spoiler-rows), minmax(0, 1fr));
}
#chat-1x1-messages .chat-lc-visual[data-visual-spoiler] .chat-lc-file :is(img, video) {
  inline-size: 100%; block-size: 100%; object-fit: cover;
}

/* Each censored word keeps the original advance, without tinting the line or drawing a box. */
.chat-word-mask {
  position: relative; display: inline-block; box-sizing: border-box; inline-size: var(--word-inline);
  max-inline-size: 100%; block-size: 1.12em; vertical-align: -.13em; padding: 0; border: 0;
  border-radius: 0; background: none; color: inherit; font: inherit; line-height: 1.12;
  letter-spacing: inherit; text-align: start; white-space: nowrap; overflow: hidden; cursor: pointer;
  user-select: none;
}
.chat-word-mask:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
.chat-word-dust { position: absolute; inset: .09em 0; overflow: hidden; pointer-events: none; }
.chat-word-dust i {
  position: absolute; inset: var(--dot-y) auto auto var(--dot-x); inline-size: var(--dot-size); block-size: var(--dot-size);
  border-radius: 50%; background: currentColor; opacity: .78;
  animation: chat-word-drift var(--dot-period) var(--dot-delay) ease-in-out infinite alternate;
}
@keyframes chat-word-drift {
  from { transform: translate(calc(-.5 * var(--dot-drift)), -2px) scale(.65); opacity: .49; }
  to { transform: translate(var(--dot-drift), 2px) scale(1.12); opacity: .98; }
}
@media (prefers-reduced-motion: reduce) { .chat-word-dust i { animation: none; } }
html[data-hub-motion="reduced"] .chat-word-dust i { animation: none; }
@media (forced-colors: active) { .chat-word-dust i { background: CanvasText; forced-color-adjust: none; } }

/* On a very tall portrait the type is evident from the accessibility label.
   Reserve the upper corner for the actions instead of covering the type label. */
@container (max-width: 174px) {
  .chat-lc-visual[data-visual-spoiler] .chat-lc-media-type { display: none; }
}
