.voice-player { --progress: 0%; --voice-accent: var(--app-orange, #ff6a3d); display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 10px 12px 10px 10px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 22px; background: linear-gradient(135deg, rgba(255, 106, 61, .12), rgba(255, 255, 255, .03) 60%), var(--app-surface-2, #202329); color: inherit; }
.voice-player audio { display: none; }
.voice-play { position: relative; display: grid; flex: 0 0 46px; width: 46px; height: 46px; place-items: center; border: 0; border-radius: 50%; color: #160700; background: var(--voice-accent); box-shadow: 0 6px 18px rgba(255, 106, 61, .35); font-size: 19px; cursor: pointer; transition: transform .15s ease; }
.voice-play:active { transform: scale(.92); }
.voice-player.is-playing .voice-play::after { position: absolute; inset: -5px; content: ""; border: 2px solid var(--voice-accent); border-radius: 50%; opacity: .6; animation: voice-ring 1.4s ease-out infinite; }
.voice-content { display: grid; flex: 1; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; min-width: 0; }
.voice-content strong { grid-column: 1 / -1; display: block; margin: 0; color: rgba(247, 244, 239, .55); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.voice-track { position: relative; min-width: 0; height: 30px; }
.voice-scope { display: block; width: 100%; height: 100%; }
.voice-content input[data-voice-seek] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.voice-time { color: rgba(247, 244, 239, .7); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.voice-speed { flex: 0 0 auto; min-width: 38px; height: 26px; padding: 0 8px; border: 0; border-radius: 13px; background: rgba(255, 255, 255, .1); color: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.voice-player.is-preview .voice-speed { display: none; }
.voice-composer { padding: 16px; margin: 12px 0; border: 1px solid #9cddbf55; border-radius: 18px; }
.voice-heading { display: flex; flex-wrap: wrap; gap: 5px 16px; justify-content: space-between; }
.voice-heading span, .voice-composer p { font-size: 13px; color: var(--app-muted, #aaa); }
.voice-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.voice-record-wave { display: none; }
.voice-composer[data-mode="recording"] .voice-record-wave { display: flex; }
.voice-composer[data-mode="recording"] .voice-record-wave i { animation: voice-pulse .5s var(--delay) ease-in-out infinite alternate; }
.voice-composer[data-mode="recording"] [data-voice-record] { background: #ee765f; }
.voice-file { position: relative; cursor: pointer; }
.voice-file input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.voice-composer[data-mode="uploading"] .voice-actions { pointer-events: none; opacity: .6; }
.voice-player :focus-visible, .voice-actions :focus-visible { outline: 2px solid #9cddbf; outline-offset: 3px; }
@keyframes voice-pulse { to { transform: scaleY(.55); } }
@keyframes voice-ring { from { opacity: .6; transform: scale(1); } to { opacity: 0; transform: scale(1.35); } }
@media (max-width: 420px) { .voice-player { gap: 9px; padding: 8px 10px 8px 8px; } }
@media (prefers-reduced-motion: reduce) { .voice-wave i, .voice-play::after { animation: none !important; } }

/* Keep attachments together and publication on its own row. */
#appComposeSheet .app-sheet-heading h2 { font-size: clamp(1.65rem, 6vw, 2.2rem); }
#appComposeForm { display: flex; flex-direction: column; gap: 12px; }
#appComposeForm .app-compose-author { margin: 0; }
#appComposeBody { width: 100%; box-sizing: border-box; min-height: 145px; max-height: 32vh; border-radius: 18px; }
.app-compose-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.app-compose-tools > .app-media-button,
.app-compose-tools > .app-text-button,
.app-compose-tools > .app-emote-open { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: auto; min-height: 40px; padding: 0 13px; margin: 0; border: 1px solid var(--app-line, #ffffff25); border-radius: 12px; background: var(--app-surface, #20252d); color: inherit; font-size: 13px; }
#appComposeForm .voice-composer { margin: 0; }
#appComposeForm .app-compose-footer { justify-content: space-between; margin: 0; padding-top: 12px; border-top: 1px solid var(--app-line, #ffffff25); }
#appComposeForm .app-compose-footer > span { margin: 0; }
#appComposeSubmit { min-width: 120px; }
#appComposeStatus:empty { display: none; }
#socialComposer .social-compose-tools { display: flex; flex-wrap: wrap; gap: 8px; }
#socialComposer .social-composer-footer { padding-top: 12px; }
#socialComposer .social-tool-button, .social-compose-more summary { display: inline-flex; align-items: center; min-height: 40px; padding: 0 13px; border: 1px solid #ffffff25; border-radius: 12px; background: #ffffff06; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.social-compose-more { position: relative; }
.social-compose-more summary { list-style: none; }
.social-compose-more summary::-webkit-details-marker { display: none; }
.social-compose-more > div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.social-compose-publish { display: flex; justify-content: flex-end; margin-top: 14px; padding-top: 14px; border-top: 1px solid #ffffff25; }
.app-comment-form, .social-comment-form { flex-wrap: wrap; align-items: center; }
.app-comment-form > input[name="body"], .social-comment-form > input[name="body"] { flex: 1 1 100%; width: 100%; box-sizing: border-box; }
.app-comment-form > button[type="submit"], .social-comment-form > button[type="submit"] { margin-left: auto; min-height: 36px; }
.app-comment-form .comment-voice-button, .social-comment-form .comment-voice-button { width: 36px; height: 36px; padding: 0; border: 1px solid #9cddbf55; border-radius: 50%; background: #9cddbf15; color: inherit; cursor: pointer; }
.app-comment-media-preview, .social-comment-media-preview, .comment-voice-composer { flex: 1 1 100%; min-width: 0; box-sizing: border-box; }
.comment-voice-composer { margin: 4px 0; }
.app-comment-form .voice-actions button, .social-comment-form .voice-actions button { width: auto; min-height: 36px; padding: 8px 12px; border-radius: 12px; }
.app-comment-form .voice-play, .social-comment-form .voice-play { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; }
.app-comment-form .voice-content input, .social-comment-form .voice-content input { padding: 0; border: 0; background: transparent; border-radius: 0; }
.app-comment-form .voice-file input, .social-comment-form .voice-file input { min-height: 0; padding: 0; }
.app-comment > div > .voice-player { margin: 8px 0; }
body[data-page="social"] .social-comment-form { display: flex; flex-wrap: wrap; }
body[data-page="social"] .social-comment-form .social-comment-media-preview { max-width: none; width: 100%; overflow: visible; }
body[data-page="social"] .social-comment-form .voice-content input { min-height: 16px; padding: 0; border: 0; background: transparent; box-shadow: none; }
body[data-page="social"] .social-comment-form .voice-file input { min-height: 0; padding: 0; }
.comment-voice-composer[hidden], .voice-composer[hidden] { display: none; }

/* Shared writing and attachment layout, from desktop to the mobile sheet. */
#appComposeSheet { padding: 20px 18px max(18px, env(safe-area-inset-bottom)); }
#appComposeSheet .app-sheet-heading { align-items: flex-start; margin-bottom: 18px; }
#appComposeSheet .app-sheet-heading h2 { margin: 4px 0 0; font-size: 1.85rem; letter-spacing: -.035em; }
#appComposeForm .app-compose-author { padding: 2px 0 4px; font-size: 14px; }
.compose-writing { overflow: hidden; border: 1px solid var(--app-line, var(--social-line, #ffffff25)); border-radius: 18px; background: var(--app-surface, var(--social-surface, #ffffff06)); transition: border-color .18s; }
.compose-writing:focus-within { border-color: #9cddbf99; }
#appComposeBody, #socialComposer #socialPostBody { display: block; min-height: 128px; width: 100%; margin: 0; padding: 16px; box-sizing: border-box; border: 0; border-radius: 0; box-shadow: none; outline: 0; background: transparent; color: inherit; font: inherit; font-size: 15px; line-height: 1.6; resize: vertical; }
.compose-writing-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 16px 12px; color: var(--app-muted, var(--social-muted, #aaa)); font-size: 11px; }
.compose-writing-meta > span:last-child { flex-shrink: 0; font-variant-numeric: tabular-nums; }
#appComposeForm .app-compose-tools, #socialComposer .social-compose-tools { padding: 4px 0; }
.app-compose-tools > button[aria-expanded="true"], #socialComposer button[aria-expanded="true"] { border-color: #9cddbf; background: #9cddbf18; }
.compose-publish-hint { font-size: 12px; color: var(--app-muted, var(--social-muted, #aaa)); }
#appComposeForm .app-compose-footer, #socialComposer .social-compose-publish { justify-content: space-between; align-items: center; }
#appComposeSubmit, #socialPostSubmit { display: inline-flex; justify-content: center; align-items: center; gap: 18px; min-height: 44px; border-radius: 14px; }
#socialComposer .social-composer-heading { align-items: center; gap: 12px; margin-bottom: 16px; }
#socialComposer .social-composer-heading h2 { font-size: 1.6rem; letter-spacing: -.025em; }
#socialComposer .social-composer-heading .eyebrow { font-size: 10px; margin-bottom: 4px; }
#socialComposer .social-media-preview { margin: 12px 0; padding: 0; border: 0; background: transparent; }
#socialComposer .social-media-preview > img, #socialComposer .social-media-preview > video, #socialComposer .social-media-preview .social-media-open-button { max-height: 220px; border-radius: 16px; overflow: hidden; }
#appUploadPreview { gap: 10px; margin: 0; }
#appUploadPreview .app-upload-preview-item { min-height: 120px; border-radius: 16px; }
#appUploadPreview .app-upload-preview-item.is-voice { grid-column: 1 / -1; display: block; min-height: 0; padding: 12px 42px 12px 12px; background: transparent; }
#appUploadPreview .is-voice > .voice-player { border: 0; padding: 0; background: transparent; }
#appQuotePreview { padding: 14px; border-radius: 16px; border-left: 3px solid #9cddbf; }
#socialComposer .social-poll-editor { margin-top: 12px; padding: 14px; border: 1px solid var(--social-line, #ffffff25); border-radius: 16px; }

.voice-track input[data-voice-seek] { inset: -7px 0; height: 44px; }
.voice-track:focus-within { outline: 2px solid var(--app-orange, #ff6a3d); outline-offset: 3px; border-radius: 4px; }
.voice-composer { background: linear-gradient(135deg, #9cddbf0d, transparent); border-color: #9cddbf38; padding: 16px; }
.voice-heading { align-items: center; }
.voice-heading > div { display: grid; gap: 4px; }
.voice-eyebrow { font-size: 9px !important; letter-spacing: .12em; font-weight: 700; color: #9cddbf !important; }
.voice-heading strong { font-size: 15px; }
.voice-dismiss, .app-comment-form .voice-dismiss, .social-comment-form .voice-dismiss { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; padding: 0; border: 1px solid #ffffff18; border-radius: 50%; background: transparent; color: inherit; font-size: 20px; cursor: pointer; }
.voice-record-stage { display: flex; align-items: center; gap: 14px; padding: 20px 0 12px; }
.voice-mic-badge { display: grid; place-items: center; width: 52px; height: 52px; flex: 0 0 52px; border-radius: 18px; background: #9cddbf16; color: #9cddbf; }
.voice-mic-badge svg { width: 25px; height: 25px; }
.voice-phase { display: block; font-size: 11px; color: var(--app-muted, #aaa); margin-bottom: 4px; }
.voice-clock { display: block; font-size: 26px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.voice-clock small { font-size: 13px; font-weight: 400; color: var(--app-muted, #aaa); letter-spacing: 0; }
.voice-record-progress { height: 4px; border-radius: 4px; background: #9cddbf16; overflow: hidden; }
.voice-record-progress i { display: block; width: var(--record-progress, 0%); height: 100%; background: #9cddbf; transition: width .1s linear; }
.voice-composer p { margin: 12px 0; font-size: 12px; line-height: 1.5; }
.voice-actions .voice-primary { display: inline-flex; gap: 8px; align-items: center; justify-content: center; flex: 1; min-height: 44px; border: 0; border-radius: 12px; padding: 10px 14px; font: inherit; font-size: 13px; font-weight: 650; background: #9cddbf; color: #11241c; cursor: pointer; }
.voice-actions .voice-secondary { min-height: 44px; border: 1px solid #ffffff25; border-radius: 12px; padding: 10px 14px; background: transparent; color: inherit; cursor: pointer; }
.voice-import { margin-top: 14px; font-size: 11px; color: var(--app-muted, #aaa); }
.voice-import summary { width: fit-content; cursor: pointer; }
.voice-import .voice-file { display: inline-block; margin-top: 10px; padding: 8px 0; }
.voice-composer[data-mode="recording"] .voice-mic-badge { color: #f4937c; background: #f4937c18; }
.voice-composer[data-mode="recording"] .voice-record-progress i { background: #f4937c; }
.voice-composer[data-mode="recording"] .voice-mic-badge { animation: voice-breathe 1.5s ease-in-out infinite; }
.voice-composer[data-mode="ready"] .voice-record-stage, .voice-composer[data-mode="ready"] .voice-record-progress,
.voice-composer[data-mode="uploading"] .voice-record-stage, .voice-composer[data-mode="uploading"] .voice-record-progress { display: none; }
.voice-composer[data-mode="recording"] .voice-import, .voice-composer[data-mode="requesting"] .voice-import, .voice-composer[data-mode="uploading"] .voice-import { display: none; }
.voice-actions [hidden] { display: none !important; }
.voice-composer button:disabled { opacity: .55; cursor: wait; }
@keyframes voice-breathe { 50% { box-shadow: 0 0 0 7px #f4937c0a; } }
@media (prefers-reduced-motion: reduce) { .voice-composer[data-mode="recording"] .voice-mic-badge { animation: none; } .voice-play, .voice-record-progress i, .compose-writing { transition: none; } }
@media (max-width: 380px) { .compose-writing-meta { padding: 0 12px 10px; font-size: 10px; gap: 6px; } .app-compose-tools > .app-media-button, .app-compose-tools > button { padding: 0 10px; } }
