.pm-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:6px; padding:0 0 7px; }
.pm-toolbar button,.pm-dialog button,.pm-card button { display:inline-flex; justify-content:center; align-items:center; gap:7px; font:inherit; font-size:13px; line-height:1.5; padding:8px 12px; min-height:44px; border:1px solid var(--qmx-line,var(--line,#80928c)); border-radius:12px; background:var(--qmx-soft,var(--soft,#eceee8)); color:var(--qmx-ink,var(--ink,#173b35)); cursor:pointer; white-space:normal; touch-action:manipulation; }
.pm-toolbar button { padding:6px 10px; }
.pm-toolbar .pm-voice-entry { font-weight:700; }
.pm-button-icon { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; flex:0 0 auto; }
.pm-button-icon svg { display:block; width:100%; height:100%; }
.pm-toolbar button:disabled,.pm-dialog button:disabled { opacity:.5; cursor:not-allowed; }
.pm-dialog [hidden],.pm-toolbar [hidden] { display:none!important; }
.pm-dialog button:focus-visible,.pm-policy summary:focus-visible { outline:3px solid var(--qmx-brand-2,#16806b); outline-offset:4px; }
.pm-dialog { color:var(--qmx-ink,var(--ink,#173b35)); background:var(--qmx-surface,var(--surface,#fffdf8)); border:1px solid var(--qmx-line,var(--line,#80928c)); border-radius:26px; width:min(1000px,calc(100vw - 48px)); max-width:none; max-height:calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding:20px; box-sizing:border-box; overflow:auto; overscroll-behavior:contain; box-shadow:0 28px 100px rgb(0 0 0 / .28); }
.pm-dialog[open] { display:flex; flex-direction:column; }
.pm-dialog::backdrop { background:rgba(5,18,22,.76); }
.pm-dialog header { display:flex; flex-shrink:0; gap:14px; align-items:center; justify-content:space-between; margin-bottom:14px; }
.pm-dialog header button { flex-shrink:0; }
.pm-dialog h2 { margin:0; font:700 clamp(21px,2.5vw,28px)/1.35 Georgia,'Noto Serif SC',serif; white-space:pre-line; }
.pm-actions { display:flex; flex-wrap:wrap; flex-shrink:0; gap:10px; margin:12px 0; }
.pm-mode-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin-top:0; }
.pm-mode-actions button { flex-direction:column; gap:10px; min-height:90px; padding:14px 10px; font-size:14px; white-space:pre-line; }
.pm-mode-actions .pm-button-icon { width:28px; height:28px; }
.pm-dialog .pm-primary { background:var(--qmx-modal-action,var(--qmx-brand,var(--ink,#173b35))); color:var(--qmx-modal-action-ink,var(--qmx-on-brand,var(--soft,#f4f2eb))); border-color:transparent; min-height:50px; font-weight:700; padding:12px 24px; }
.pm-footer { justify-content:flex-end; margin:8px 0; }
.pm-footer button { white-space:pre-line; }
.pm-note,.pm-status { font-size:13px; line-height:1.65; white-space:pre-line; overflow-wrap:anywhere; }
.pm-status { flex-shrink:0; min-height:22px; margin:10px 0 4px; color:var(--qmx-muted,var(--muted,#53645e)); }
.pm-policy { flex-shrink:0; border-top:1px solid var(--qmx-line,var(--line,#80928c)); margin-top:10px; padding-top:12px; color:var(--qmx-muted,var(--muted,#53645e)); }
.pm-policy summary { cursor:pointer; font-size:13px; line-height:1.7; white-space:pre-line; }
.pm-policy .pm-note { margin-bottom:0; }
.pm-preview:empty,.pm-capture-controls:empty { display:none; }
.pm-stage { min-width:0; }
.pm-preview img,.pm-preview video { display:block; width:100%; max-width:100%; height:auto; max-height:64dvh; object-fit:contain; border-radius:18px; background:#07100e; }
.pm-preview audio,.pm-card audio { display:block; max-width:100%; width:100%; }
.pm-dialog.is-capture { height:min(900px,calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); }
.pm-dialog.is-capture .pm-stage { display:flex; flex-direction:column; flex:1 1 auto; min-height:180px; overflow:hidden; border-radius:20px; background:#07100e; color:#fff; }
.pm-dialog.is-capture .pm-preview { position:relative; display:flex; align-items:center; justify-content:center; flex:1 1 auto; min-height:0; overflow:hidden; }
.pm-dialog.is-capture .pm-preview video { position:absolute; inset:0; width:100%; height:100%; max-height:none; object-fit:contain; border-radius:0; }
.pm-camera-wait { padding:24px; max-width:480px; line-height:1.8; text-align:center; white-space:pre-line; }
.pm-capture-controls { position:relative; display:flex; flex-shrink:0; flex-direction:column; justify-content:center; align-items:center; gap:10px; padding:14px 16px 18px; background:linear-gradient(180deg,#101c18,#07100e); }
.pm-dialog .pm-capture-button { display:flex; flex-direction:column; min-width:144px; min-height:106px; padding:4px 14px; gap:10px; border:0; border-radius:18px; background:transparent; color:#fff; font-size:15px; font-weight:700; white-space:pre-line; }
.pm-dialog .pm-capture-button .pm-button-icon { width:78px; height:78px; box-sizing:border-box; border:4px solid #fff; border-radius:50%; padding:4px; background:#fff; color:#17241f; box-shadow:0 0 0 3px rgb(255 255 255 / .2); }
.pm-dialog .pm-capture-startVideo .pm-button-icon { color:#e44335; }
.pm-dialog .pm-capture-stop { min-width:176px; min-height:128px; }
.pm-dialog .pm-capture-stop .pm-button-icon { width:92px; height:92px; background:#c33328; color:#fff; }
.pm-dialog .pm-capture-button:focus-visible { outline-color:#fff; }
.pm-record-clock { display:block; font:700 19px/1.4 ui-monospace,monospace; color:inherit; font-variant-numeric:tabular-nums; letter-spacing:.06em; }
.pm-dialog.is-capture[data-capture-kind="audio"] .pm-stage,.pm-dialog[data-capture-kind="audio"] .pm-capture-controls { background:var(--qmx-soft,var(--soft,#eceee8)); color:var(--qmx-ink,var(--ink,#173b35)); }
.pm-dialog[data-capture-kind="audio"] .pm-capture-button { color:var(--qmx-ink,var(--ink,#173b35)); }
.pm-dialog[data-capture-kind="audio"] .pm-capture-button:focus-visible { outline-color:var(--qmx-brand-2,#16806b); }
.pm-voice-stage { display:flex; flex-direction:column; align-items:center; justify-content:center; width:100%; padding:20px; box-sizing:border-box; text-align:center; }
.pm-voice-stage .pm-voice-mark { width:clamp(48px,9vh,86px); height:clamp(48px,9vh,86px); padding:22px; border-radius:50%; background:var(--qmx-surface,var(--surface,#fffdf8)); color:var(--qmx-brand-2,#16806b); }
.pm-voice-stage h3 { margin:20px 0 10px; font-size:clamp(22px,3vw,30px); white-space:pre-line; }
.pm-voice-stage p { max-width:460px; margin:12px 0 0; font-size:14px; line-height:1.6; white-space:pre-line; }
.pm-recording-pulse { display:flex; gap:7px; align-items:center; height:28px; }
.pm-recording-pulse i { display:block; width:7px; height:7px; border-radius:50%; background:var(--qmx-brand-2,#16806b); }
.is-recording .pm-recording-pulse i { animation:pm-recording-pulse 1.4s ease-in-out infinite; }
.pm-recording-pulse i:nth-child(2),.pm-recording-pulse i:nth-child(4) { animation-delay:.15s; }.pm-recording-pulse i:nth-child(3) { animation-delay:.3s; }
.pm-voice-preview { display:flex; align-items:center; justify-content:center; flex-direction:column; gap:18px; min-height:180px; padding:24px; margin-bottom:16px; border-radius:20px; background:var(--qmx-soft,var(--soft,#eceee8)); white-space:pre-line; text-align:center; }
.pm-voice-preview .pm-button-icon { width:58px; height:58px; color:var(--qmx-brand-2,#16806b); }
.pm-card { min-width:160px; max-width:min(360px,65vw); overflow-wrap:anywhere; }
.pm-card img,.pm-card video { display:block; max-width:100%; max-height:320px; object-fit:contain; border-radius:12px; }
.pm-card .pm-actions { margin-bottom:0; }
.pm-local-row { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:12px 0; border-top:1px solid var(--qmx-line,var(--line,#80928c)); }
.pm-local-row>span { flex:1; min-width:100px; }
@keyframes pm-recording-pulse { 0%,100% { opacity:.4;transform:scale(.8); } 50% { opacity:1;transform:scale(1.2); } }
@media(prefers-reduced-motion:reduce) { .is-recording .pm-recording-pulse i { animation:none; } }
@media(max-width:640px) {
  .pm-dialog { padding:16px; width:calc(100vw - 16px); max-height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius:22px; }
  .pm-dialog.is-capture { margin:auto; width:100vw; height:100dvh; max-height:100dvh; padding:calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)); border-radius:0; border:0; }
  .pm-dialog.is-capture header { margin-bottom:10px; }.pm-dialog.is-capture h2 { font-size:21px; }
  .pm-dialog.is-capture .pm-stage { border-radius:16px; min-height:140px; }
  .pm-capture-controls { padding:12px 12px 16px; }
  .pm-mode-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .pm-mode-actions button { min-height:88px; }
  .pm-footer { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }.pm-footer .pm-primary { grid-column:1/-1; grid-row:1; }
  .pm-footer button { min-width:0; padding:10px; }.pm-card { max-width:70vw; }
  .pm-dialog.is-review .pm-mode-actions button { min-height:48px; flex-direction:row; font-size:12px; padding:7px; gap:6px; }.pm-dialog.is-review .pm-mode-actions .pm-button-icon { width:19px;height:19px; }
}
@media(max-height:620px) {
  .pm-dialog.is-capture { padding-top:max(8px,env(safe-area-inset-top));padding-bottom:max(8px,env(safe-area-inset-bottom)); }
  .pm-dialog.is-capture .pm-stage { flex-direction:row; min-height:120px; }.pm-capture-controls { flex:0 0 150px; padding:12px; }.pm-dialog .pm-capture-stop .pm-button-icon { width:76px;height:76px; }
  .pm-voice-stage { padding:10px; }.pm-voice-stage .pm-voice-mark { width:38px;height:38px;padding:12px; }.pm-voice-stage h3 { margin:8px 0;font-size:20px; }.pm-voice-stage p { font-size:12px;margin-top:6px; }
}

/* Compact composer: the attachment grid is a floating menu, not another row. */
html[data-language] .compose-box.pm-has-more { grid-template-columns:38px minmax(0,1fr) 40px auto;align-items:center; }
html[data-language] .compose-box.pm-has-more #emojiButton { grid-column:1;grid-row:1; }
html[data-language] .compose-box.pm-has-more #input { grid-column:2;grid-row:1;min-width:0; }
html[data-language] .compose-box.pm-has-more #send { grid-column:4;grid-row:1; }
.pm-more-toggle { display:grid;place-items:center;width:40px;height:40px;min-width:40px;padding:0;border:1px solid var(--qmx-line,var(--line,#80928c));border-radius:12px;background:var(--qmx-soft,var(--soft,#eceee8));color:var(--qmx-ink,var(--ink,#173b35));font:400 28px/1 Georgia,serif;cursor:pointer;touch-action:manipulation; }
html[data-language] .compose-box.pm-has-more .pm-more-toggle { grid-column:3;grid-row:1; }
.pm-more-toggle[aria-expanded="true"] { background:var(--qmx-surface,var(--surface,#fffdf8));outline:2px solid var(--qmx-brand-2,#16806b);outline-offset:1px; }
.pm-more-toggle:disabled { opacity:.5;cursor:not-allowed; }
.pm-more-toggle:focus-visible,.pm-more-menu button:focus-visible { outline:3px solid var(--qmx-brand-2,#16806b);outline-offset:3px; }
.pm-more-menu[hidden] { display:none!important; }
.pm-toolbar.pm-more-menu { position:fixed;z-index:10080;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;box-sizing:border-box;padding:12px;margin:0;overflow:auto;overscroll-behavior:contain;max-width:calc(100vw - 20px);border:1px solid var(--qmx-line,var(--line,#80928c));border-radius:20px;background:var(--qmx-surface,var(--surface,#fffdf8));color:var(--qmx-ink,var(--ink,#173b35));box-shadow:0 14px 44px rgb(0 0 0 / .2); }
.pm-toolbar.pm-more-menu button { display:flex;flex-direction:column;gap:9px;min-height:86px;min-width:0;padding:12px 6px;font-size:12px;text-align:center;white-space:pre-line;overflow-wrap:anywhere; }
.pm-toolbar.pm-more-menu .pm-button-icon,.pm-toolbar.pm-more-menu .call-icon { width:25px;height:25px; }
.pm-dialog.is-voice-float { position:fixed;inset:auto;z-index:10070;margin:0;box-sizing:border-box;width:min(340px,calc(100vw - 20px));height:auto;max-height:calc(100dvh - 20px);padding:14px;border-radius:22px;border:1px solid var(--qmx-line,var(--line,#80928c));background:var(--qmx-surface,var(--surface,#fffdf8));color:var(--qmx-ink,var(--ink,#173b35));overflow:auto;box-shadow:0 16px 48px rgb(0 0 0 / .24); }
.pm-dialog.is-voice-float header { margin:0 0 8px;gap:10px; }.pm-dialog.is-voice-float h2 { font-family:inherit;font-weight:700;font-size:15px;line-height:1.5; }
.pm-dialog.is-voice-float header button { width:34px;height:34px;min-height:34px;padding:6px;flex-shrink:0; }
.pm-dialog.is-voice-float header button>[data-pm-text] { position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
.pm-dialog.is-voice-float .pm-stage { flex:0 0 auto;min-height:0;display:block;border-radius:16px;overflow:hidden; }
.pm-dialog.is-voice-float .pm-voice-stage,.pm-dialog.is-voice-float .pm-voice-preview,.pm-dialog.is-voice-float .pm-policy,.pm-dialog.is-voice-float .pm-mode-actions { display:none; }
.pm-dialog.is-voice-float .pm-capture-controls { flex:none;display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px; }
.pm-dialog.is-voice-float .pm-capture-controls:empty { display:none; }
.pm-dialog.is-voice-float .pm-record-clock { font-size:16px;letter-spacing:.02em;white-space:nowrap; }
.pm-dialog.is-voice-float.is-recording .pm-record-clock::before { content:'';display:inline-block;width:8px;height:8px;margin-right:8px;border-radius:50%;background:#c33328; }
.pm-dialog.is-voice-float .pm-capture-stop { flex:0 0 104px;min-width:0;min-height:96px;gap:7px;padding:2px;font-size:12px; }
.pm-dialog.is-voice-float .pm-capture-stop .pm-button-icon { width:64px;height:64px;border-width:3px; }
.pm-dialog.is-voice-float .pm-preview audio { margin:8px 0;min-height:48px; }
.pm-dialog.is-voice-float .pm-status { min-height:0;margin:8px 0 0;font-size:12px;line-height:1.5; }
.pm-dialog.is-voice-float .pm-footer { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:10px 0 0; }
.pm-dialog.is-voice-float .pm-footer .pm-primary { grid-column:2;grid-row:1;min-height:44px;padding:8px;font-size:13px; }
.pm-dialog.is-voice-float .pm-footer .pm-retake { grid-column:1;grid-row:1;min-height:44px;padding:8px;font-size:12px; }
.pm-dialog.is-voice-float .pm-footer .pm-retry { grid-column:1/-1;min-height:34px;padding:5px;font-size:11px; }
@media(max-width:680px) { html[data-language] .compose-box.pm-has-more { grid-template-columns:32px minmax(0,1fr) 36px auto;gap:4px; }html[data-language] .compose-box.pm-has-more .pm-more-toggle { width:36px;min-width:36px;height:40px; } }
@media(max-width:340px) { .pm-toolbar.pm-more-menu { grid-template-columns:repeat(2,minmax(0,1fr)); }.pm-dialog.is-voice-float .pm-capture-controls { gap:6px;padding:8px; }.pm-dialog.is-voice-float .pm-record-clock { font-size:14px; }.pm-dialog.is-voice-float .pm-capture-stop { flex-basis:90px; } }
