.vibe-chat-form.has-media, .home-text-stage .vibe-chat-form.has-media { grid-template-columns: 44px minmax(0, 1fr) auto; }
.vibe-chat-form .message-media-icon, .home-text-stage .vibe-chat-form .message-media-icon,
.message-media-options .message-media-icon, .message-media-draft .message-media-icon {
  display:inline-flex; align-items:center; justify-content:center; flex:0 0 44px;
  width:44px; min-width:44px; height:48px; padding:0; border:0; border-radius:0;
  background:transparent; color:#2167f5; box-shadow:none;
}
.message-media-icon:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
.message-media-options { position:fixed; z-index:3001; display:flex; flex-direction:column; align-items:center; gap:2px; width:64px; max-height:calc(100dvh - 16px); overflow-y:auto; padding:8px; box-sizing:border-box; border:1px solid rgba(255,255,255,.9); border-radius:20px; background:var(--sp-theme-surface-raised, #f7f9ff); box-shadow:0 14px 32px rgba(7,32,76,.24); backdrop-filter:blur(18px); }
.message-media-options .message-media-icon { border-radius:12px; }
.message-media-options .message-media-icon:hover, .message-media-options .message-media-icon:focus-visible { background:var(--sp-theme-surface, #e8f0ff); }
.message-media-draft { display:flex; align-items:center; gap:8px; padding:0; font-size:14px; overflow-wrap:anywhere; }
.message-media-draft span { flex:1; min-width:0; }
.message-media-options[hidden], .message-media-draft[hidden] { display:none; }
.message-attachment-open { display:block; color:inherit; background:transparent; border:0; padding:12px 0; text-align:left; text-decoration:none; font-weight:600; cursor:pointer; }
.message-inline-media { display:block; max-width:100%; width:280px; max-height:320px; object-fit:contain; margin-top:8px; }
html[data-theme="dark"] .message-media-icon { color:#a48aff; }
html[data-theme="dark"] .message-media-options { border-color:rgba(176,199,236,.27); background:#10233e; }
html[data-theme="dark"] .message-media-options .message-media-icon:hover, html[data-theme="dark"] .message-media-options .message-media-icon:focus-visible { background:#193759; }
.message-media-draft { width:min(100%, 1020px); margin-inline:auto; box-sizing:border-box; flex-shrink:0; }
.message-media-draft { flex-wrap:wrap; }
.message-media-draft .message-recording-signal { display:inline-flex; flex:0 0 28px; height:24px; align-items:center; gap:3px; }
.message-recording-signal i { width:3px; height:14px; border-radius:2px; background:#2167f5; animation:message-recording-pulse 900ms ease-in-out infinite alternate; }
.message-recording-signal i:nth-child(2n) { height:22px; animation-delay:180ms; }
.message-recording-signal i:nth-child(3) { animation-delay:360ms; }
.message-media-draft .message-recording-time { flex:0 0 auto; font-variant-numeric:tabular-nums; }
.message-media-draft .message-recording-signal[hidden], .message-media-draft .message-recording-time[hidden], .message-voice-preview[hidden] { display:none; }
.message-voice-preview { width:min(260px, 100%); height:36px; }
.message-media-options .is-recording { color:#c52c53; }
@keyframes message-recording-pulse { from { transform:scaleY(.4); opacity:.55; } to { transform:scaleY(1); opacity:1; } }
@media (prefers-reduced-motion:reduce) { .message-recording-signal i { animation:none; } }

.message-audio-controls { display:inline-flex; align-items:center; gap:10px; max-width:100%; }
.message-audio-controls[hidden] { display:none; }
.message-audio-toggle { display:inline-grid; place-items:center; flex:none; width:44px; height:44px; padding:0; background:transparent; border:0; color:inherit; cursor:pointer; }
.message-audio-toggle svg, .message-recording-pause svg { display:block; }
.message-audio-controls input { width:130px; max-width:100%; }

/* The attachment options flow up out of the + one after another, and fold back in on close. */
.message-media-options:not([hidden]) { transform-origin: 32px calc(100% + 24px); animation: sp-media-grow .42s var(--sp-ease-snappy) both; }
.message-media-options.is-closing { animation: sp-media-fold var(--sp-dur-exit, 160ms) var(--sp-ease-out) both; }
.message-media-options:not([hidden]):not(.is-closing) > * { animation: sp-media-item .44s var(--sp-ease-snappy) both; }
.message-media-options > :nth-child(1) { animation-delay: .04s !important; }
.message-media-options > :nth-child(2) { animation-delay: .085s !important; }
.message-media-options > :nth-child(3) { animation-delay: .13s !important; }
.message-media-options > :nth-child(4) { animation-delay: .175s !important; }
.message-media-options > :nth-child(5) { animation-delay: .22s !important; }
@keyframes sp-media-grow { from { opacity: 0; transform: translateY(12px) scale(.4); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes sp-media-fold { to { opacity: 0; transform: translateY(10px) scale(.5); } }
@keyframes sp-media-item { from { opacity: 0; transform: translateY(14px) scale(.7); } to { opacity: 1; transform: none; } }
/* The + turns into × while the options are open. */
[aria-controls^="message-media-options-"] svg { transition: transform .38s var(--sp-ease-snappy); }
[aria-controls^="message-media-options-"][aria-expanded="true"] svg { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) {
  .message-media-options, .message-media-options > *, [aria-controls^="message-media-options-"] svg { animation: none !important; transition: none !important; }
}

/* Recording a voice message: ❚❚ to pause and a red ● to carry on, beside the timer (Send sends it, × throws it away). */
/* They sit straight on the Home picture, so they are solid, deep Spossity violet (#7a45f0, the sheet's violet) with white
   symbols, in light and dark. */
.message-media-draft .message-recording-pause { display:inline-grid; place-items:center; flex:0 0 auto; width:40px; height:40px; padding:0; border:0; border-radius:999px; color:#fff; background:#7a45f0; box-shadow:0 4px 14px rgba(40, 14, 110, .35); cursor:pointer; }
.message-media-draft .message-recording-pause[hidden] { display:none; }
.message-recording-signal.is-paused i { animation-play-state:paused; opacity:.45; }

/* Carry on recording: the red ● (shared/audio-controls.js RECORD_RED) on white, so the red stays clear. */
.message-media-draft .message-recording-pause.is-record { color:#ff4169; background:#fff; }
/* The rest of the recording row on the picture: violet bars, the time in white, and × in the same violet circle. */
.message-media-draft:has(.message-recording-signal:not([hidden])) .message-recording-signal i { background:#7a45f0; box-shadow:0 0 0 1px rgba(255,255,255,.55); }
.message-media-draft:has(.message-recording-signal:not([hidden])) .message-recording-time { color:#fff; font-weight:700; text-shadow:0 1px 6px rgba(0,0,0,.6); }
html:root .message-media-draft:has(.message-recording-signal:not([hidden])) .message-media-icon { flex:0 0 40px; width:40px; min-width:40px; height:40px; border-radius:999px; color:#fff; background:#7a45f0; box-shadow:0 4px 14px rgba(40, 14, 110, .35); }

/* The + in the chat: brand blue with a heavier line (shared/communication-sheet.js PLUS), the same on iPhone and iPad. */
html:root body.is-logged-in .home-text-shell .vibe-chat-form .message-media-icon { color: #2167f5 !important; }
/* Send is a paper plane (shared/communication-sheet.js SEND). */
.vibe-chat-form button.vibe-send-plane { display: inline-flex; align-items: center; justify-content: center; }
.vibe-chat-form button.vibe-send-plane svg { flex: none; }

/* The + tray is liquid glass, like the rest of the chat: a dark glass rectangle, and each choice is a glass line sign on
   its own rounded glass square (squares and rectangles, never circles). Same as iPhone and iPad. Stop while recording
   stays red. Reduce Transparency: solid. */
html:root body.is-logged-in .message-media-options {
  width: 62px; gap: 8px; padding: 8px; border-radius: 20px !important; border: 1px solid rgba(255, 255, 255, .3) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, 0) 40%), rgba(14, 32, 60, .46) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important; backdrop-filter: blur(20px) saturate(180%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 14px 32px rgba(7, 32, 76, .3) !important;
}
html:root body.is-logged-in .message-media-options .message-media-icon {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px !important; border: 1px solid rgba(255, 255, 255, .6) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, .06) 55%), rgba(255, 255, 255, .16) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), 0 4px 12px rgba(16, 40, 100, .25) !important;
}
html:root body.is-logged-in .message-media-options .message-media-icon:is(:hover, :focus-visible) { border-color: #fff !important; }
html:root body.is-logged-in .message-media-options .message-media-icon.is-recording { color: #c52c53; }
@media (prefers-reduced-transparency: reduce) {
  html:root body.is-logged-in .message-media-options { background: #142c4d !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  html:root body.is-logged-in .message-media-options .message-media-icon { background: #d9dcef !important; }
}

/* A voice message: one slim row (shared/voice-wave.js LOOK) — a 32 play square, the wave that fills in as it plays, the
   length; the time sent stays under it as on every message. On your blue bubble it is white, on a received one violet. */
.message-voice{display:flex;align-items:center;gap:8px;min-height:30px;max-width:240px;--played:0%}
.message-voice-play{flex:none;display:grid;place-items:center;width:21px;height:21px;padding:0;border-radius:7px;cursor:pointer;color:inherit;
  border:1px solid rgba(122,69,240,.35);background:rgba(122,69,240,.12)}
.vibe-message.mine .message-voice-play{border-color:rgba(255,255,255,.45);background:rgba(255,255,255,.22);color:#fff}
.message-voice-play svg{width:12px;height:12px}
.message-voice.is-opening .message-voice-play{opacity:.6}
.message-voice-wave{position:relative;flex:none;width:120px;height:18px;cursor:pointer;outline-offset:3px}
.message-voice-bars{position:absolute;inset:0;display:flex;align-items:center;justify-content:space-between}
.message-voice-bars i{display:block;flex:none;width:3px;border-radius:2px;background:currentColor;opacity:.35}
.message-voice-bars.is-played i{opacity:1}
.message-voice-bars.is-played{clip-path:inset(0 calc(100% - var(--played)) 0 0);transition:clip-path .2s linear}
/* Playing: the bars move like a live signal (shared/voice-wave.js SIGNAL: 45–100% of each bar, 520ms, rippling along the row). */
.message-voice.is-playing .message-voice-bars i{transform-origin:center;animation:message-voice-signal 520ms var(--sp-ease-snappy, ease-in-out) infinite alternate;animation-delay:calc(var(--i, 0) * -74ms)}
@keyframes message-voice-signal{from{transform:scaleY(.45)}to{transform:scaleY(1)}}
.message-voice-len{flex:none;font-size:12px;font-weight:700;font-variant-numeric:tabular-nums;opacity:.85}
@media (prefers-reduced-motion:reduce){.message-voice-bars.is-played{transition:none}.message-voice.is-playing .message-voice-bars i{animation:none}}

/* A voice note is the same card as a one-line text message: same padding, the voice row in the text's line (play,
   wave, length) and the time sent under it on the right, exactly where a text message has it (shared/voice-wave.js LOOK). */
.vibe-message:has(> span > .message-voice) > span:first-child > span:empty{display:none}
.message-voice{height:21px;min-height:0;vertical-align:top}
.message-voice-draft{display:inline-flex;align-items:center;color:#fff;min-width:0}
.message-voice-draft[hidden]{display:none}
.message-voice-draft .message-voice-play{border-color:rgba(255,255,255,.45);background:rgba(255,255,255,.22);color:#fff}
.message-media-draft span[role=status]:empty{display:none}
