.ppa-voice-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 1px solid #d5dbe3;
	border-radius: 10px;
	background: #fff;
	color: #1a2332;
	cursor: pointer;
}

.ppa-voice-btn .dashicons,
.ppa-voice-btn i {
	width: 18px;
	height: 18px;
	font-size: 18px;
	line-height: 18px;
}

.ppa-voice-btn.is-recording {
	border-color: #c0392b;
	background: #fdeceb;
	color: #c0392b;
}

.ppa-reply-shell:has(.ppa-voice-draft:not([hidden])) {
	flex-wrap: wrap;
}

.ppa-voice-draft {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1 0 100%;
	order: -1;
	min-width: 0;
	margin: 0;
	padding: 8px 10px;
	border: 1px solid #e6ebf1;
	border-radius: 10px;
	background: #f7f8fb;
	box-sizing: border-box;
}

.ppa-voice-draft[hidden] {
	display: none !important;
}

.ppa-voice-draft audio {
	flex: 1 1 160px;
	width: auto;
	min-width: 140px;
	max-width: 100%;
	height: 32px;
}

.ppa-voice-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #c0392b;
}

.ppa-voice-time,
.ppa-voice-duration {
	flex: 0 0 auto;
	color: #5b6573;
	font-size: 12px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	overflow-wrap: normal;
	word-break: normal;
}

.ppa-voice-discard {
	flex: 0 0 auto;
	margin-inline-start: auto;
	border: 0;
	background: transparent;
	color: #c0392b;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
	cursor: pointer;
}

.ppa-voice-replies-list {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	width: 100%;
	margin-top: 8px;
}

.ppa-voice-item {
	display: block;
	width: min(100%, 340px);
	margin: 0;
}

.ppa-voice-player {
	display: flex;
	align-items: center;
	gap: 8px;
	box-sizing: border-box;
	width: 100%;
	min-width: 220px;
	padding: 6px 10px;
	border-radius: 20px;
}

.ppa-voice-player audio,
.ppa-voice-item > audio,
.ppa-audio-player {
	flex: 1 1 180px;
	width: 200px;
	min-width: 160px;
	max-width: 100%;
	height: 32px;
}

/* Keep the microphone aligned with the shared modal's attachment control. */
.ppa-reply-shell .ppa-reply-actions > .ppa-voice-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    box-sizing: border-box;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    margin: 0;
    padding: 0;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    box-shadow: none;
    line-height: 1;
    vertical-align: middle;
    transform: none;
}
.ppa-reply-shell .ppa-voice-btn .ppa-voice-mic {
    display: block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0;
    fill: none;
    stroke: currentColor;
}
.ppa-voice-btn > .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
.ppa-reply-shell .ppa-reply-actions > .ppa-voice-btn:hover {
    border-color: #2271b1;
    color: #2271b1;
    background: #f0f6fc;
}
.ppa-voice-btn:focus-visible { outline: 2px solid #2271b1; outline-offset: 2px; }
.ppa-reply-shell .ppa-reply-actions > .ppa-voice-btn.is-recording {
    border-color: #c0392b;
    background: #fdeceb;
    color: #c0392b;
}
body.ppa-order-workspace .ppa-reply-shell .ppa-reply-actions > .ppa-voice-btn {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    flex-basis: 32px;
    border-radius: 6px;
}


/* Shared voice player; native controls remain available if enhancement fails. */
.ppa-voice-player{min-width:0;max-width:100%;padding:0;border-radius:0;background:transparent!important;display:block}
.ppa-chat-message .ppa-voice-player:has(.ppa-vp){max-width:100%;width:100%;padding:0;display:block}
.ppa-voice-item{width:min(100%,360px);min-width:0}
.ppa-voice-player:has(.ppa-vp)>.ppa-voice-duration{display:none}
.ppa-vp{display:flex!important;align-items:center;gap:10px;width:100%;min-width:0;box-sizing:border-box;padding:10px 12px;border:1px solid #cbdde8;border-radius:14px;background:#f2f8fc;color:#17364c;line-height:1.5;direction:rtl;text-align:right}
.ppa-vp .ppa-vp-media{display:none!important}
.ppa-vp button{appearance:none;display:inline-flex;align-items:center;justify-content:center;margin:0;padding:0;border:0;box-shadow:none;cursor:pointer;font-family:inherit;line-height:1;color:inherit}
.ppa-vp .ppa-vp-play{flex:0 0 42px;width:42px;height:42px;border-radius:50%;background:#007cac;color:white;font-size:17px}
.ppa-vp.is-playing .ppa-vp-play{background:#075f87}
.ppa-vp .ppa-vp-speed{flex:0 0 38px;min-width:38px;height:32px;background:white;border:1px solid #c9dce7;border-radius:8px;font-size:12px;font-weight:700;direction:ltr}
.ppa-vp-main{flex:1 1 auto;min-width:0}
.ppa-vp-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:2px 6px;font-size:11px;font-weight:600;white-space:nowrap}
.ppa-vp-time{font-variant-numeric:tabular-nums;font-size:11px;color:#456273}
.ppa-vp input.ppa-vp-seek{display:block;width:100%;min-width:0;height:22px;margin:3px 0 0;padding:0;accent-color:#007cac;cursor:pointer;box-shadow:none;border:0;direction:ltr}
.ppa-vp-status{display:block;font-size:11px;color:#8d3c09;white-space:normal;overflow-wrap:anywhere}
.ppa-vp-status:empty{display:none}
.ppa-vp button:focus-visible,.ppa-vp input:focus-visible{outline:2px solid #007cac;outline-offset:3px}
.ppa-voice-draft{flex-wrap:wrap;grid-column:1/-1;grid-row:auto;order:-1;max-width:100%;gap:8px}
.ppa-voice-draft>.ppa-vp{flex:1 1 220px;min-width:0}
.ppa-voice-draft:has(.ppa-vp)>.ppa-voice-time{display:none}
.ppa-voice-warning{flex:1 0 100%;font-size:12px;color:#943e11;line-height:1.8}
.ppa-voice-warning:empty{display:none}
.ppa-voice-meter{width:70px;height:10px;flex:0 1 70px;accent-color:#00845f}
.ppa-voice-draft .ppa-voice-discard{min-height:32px;padding:4px 8px;border-radius:7px;background:#fff5f3}
[data-ppa-voice-state="requesting"] .ppa-voice-btn,[data-ppa-voice-state="stopping"] .ppa-voice-btn{opacity:.6;cursor:wait}
@media(max-width:782px){
 .ppa-vp{gap:7px;padding:8px;border-radius:12px}
 .ppa-vp .ppa-vp-play{width:38px;height:38px;flex-basis:38px}
 .ppa-vp-heading{font-size:10px}
 .ppa-vp-time{font-size:10px}
 .ppa-vp .ppa-vp-speed{min-width:33px;flex-basis:33px;font-size:11px}
 .ppa-reply-shell:has(.ppa-voice-draft:not([hidden])) .ppa-voice-draft{grid-row:2;grid-column:1/-1;padding:6px}
 .ppa-reply-shell:has(.ppa-voice-draft:not([hidden])) .ppa-reply-toolbar,.ppa-reply-shell:has(.ppa-voice-draft:not([hidden])) .ppa-reply-actions{grid-row:3!important}
}
