/* Shared media controls inherit Snow's quiet palette; the image canvas stays dark. */
.pswp{z-index:25000;--pswp-icon-color:#f6f6fa;--pswp-bg:#090c12}
.pswp__top-bar{padding-top:env(safe-area-inset-top,0px)}
.pswp .snow-gallery-original{display:flex;align-items:center;padding:0 14px;color:#fff;font:14px/1.4 system-ui;text-decoration:underline;white-space:nowrap}
.pswp__button,.pswp__counter{margin-top:0}
.pswp .snow-gallery-collect{position:fixed;left:50%;bottom:calc(22px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:auto;min-width:126px;height:44px;padding:0 18px;border:1px solid rgba(240,245,255,.35);border-radius:24px;background:rgba(15,24,38,.88);color:#fff;font:14px/1.4 system-ui;white-space:nowrap}
.pswp .snow-gallery-collect:disabled{opacity:.75;cursor:default}.pswp .snow-gallery-collect:focus-visible{outline:2px solid white;outline-offset:4px}
/* Shu 2026-11-27 「存到手机」 sits right of 「存进相簿」 (chat viewer only; album/moments keep one centred button). */
.pswp .snow-gallery-phone{position:fixed;left:calc(50% + 6px);bottom:calc(22px + env(safe-area-inset-bottom,0px));width:auto;min-width:112px;max-width:calc(50vw - 18px);height:44px;padding:0 16px;border:1px solid rgba(240,245,255,.35);border-radius:24px;background:rgba(15,24,38,.88);color:#fff;font:14px/1.4 system-ui;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pswp .snow-gallery-phone:disabled{opacity:.75;cursor:default}.pswp .snow-gallery-phone:focus-visible{outline:2px solid white;outline-offset:4px}
.pswp:has(.snow-gallery-phone) .snow-gallery-collect{left:calc(50% - 6px);transform:translateX(-100%);max-width:calc(50vw - 18px);overflow:hidden;text-overflow:ellipsis}
.pswp--touch .pswp__button--arrow{visibility:visible}
/* Shu 2026-11-11: chat picture → pick an album group (sits above 「存进相簿」, lifts over the keyboard). */
.pswp .snow-gallery-groups{position:fixed;left:12px;right:12px;bottom:calc(78px + env(safe-area-inset-bottom,0px) + var(--snow-kb,0px));z-index:2;box-sizing:border-box;max-width:440px;max-height:min(60vh,420px);margin:0 auto;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;padding:12px 14px 14px;border:1px solid rgba(240,245,255,.28);border-radius:18px;background:rgba(15,24,38,.95);color:#fff;font:14px/1.45 system-ui;box-shadow:0 10px 30px rgba(0,0,0,.35)}
.pswp .snow-gallery-groups[hidden]{display:none}
.pswp .snow-groups-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.pswp .snow-groups-head strong{font-size:15px;font-weight:600}
.pswp .snow-groups-close{width:36px;height:36px;margin:-6px -8px -6px 0;border:0;border-radius:18px;background:transparent;color:#fff;font-size:22px;line-height:1;cursor:pointer}
.pswp .snow-groups-note{margin:0 0 8px;color:rgba(235,241,250,.72);font-size:13px}
.pswp .snow-groups-chips{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 12px}
.pswp .snow-groups-chip{min-height:38px;padding:0 14px;border:1px solid rgba(240,245,255,.32);border-radius:19px;background:rgba(255,255,255,.07);color:#fff;font:14px/1.2 system-ui;cursor:pointer}
.pswp .snow-groups-chip.is-current{border-color:#fff;background:#fff;color:#152033;font-weight:600}
.pswp .snow-groups-wait{color:rgba(235,241,250,.72);font-size:13px;padding:8px 0}
.pswp .snow-groups-new{display:flex;gap:8px}
.pswp .snow-groups-new input{flex:1;min-width:0;height:40px;box-sizing:border-box;padding:0 12px;border:1px solid rgba(240,245,255,.32);border-radius:12px;background:rgba(255,255,255,.08);color:#fff;font:16px/1.2 system-ui}
.pswp .snow-groups-new input::placeholder{color:rgba(235,241,250,.55)}
.pswp .snow-groups-new button{flex:none;height:40px;padding:0 14px;border:0;border-radius:12px;background:#f3f1eb;color:#152033;font:14px/1.2 system-ui;font-weight:600;cursor:pointer}
.pswp .snow-groups-new button:disabled{opacity:.45;cursor:default}
.pswp .snow-gallery-groups button:focus-visible,.pswp .snow-groups-new input:focus-visible{outline:2px solid #fff;outline-offset:2px}
.avatar-editor,.media-fallback{box-sizing:border-box;width:min(94vw,480px);max-height:calc(100dvh - 32px);overflow:auto;margin:auto;border:1px solid #d4d7de;border-radius:18px;padding:20px;background:#f5f4f1;color:#283343;font:14px/1.55 system-ui}
.avatar-editor::backdrop,.media-fallback::backdrop{background:rgb(5 10 18 / .76)}
html[data-theme="snow"] .avatar-editor,html[data-theme="snow"] .media-fallback{background:#182332;color:#e1e8f0;border-color:#455466}
.avatar-editor header,.avatar-editor footer,.avatar-crop-tools{display:flex;align-items:center;justify-content:space-between;gap:12px}
.avatar-editor h2{font-family:inherit;font-size:19px;line-height:1.4;font-weight:600;margin:0}
.avatar-editor button,.media-fallback button,.media-fallback a{box-sizing:border-box;min-height:44px;min-width:44px;padding:9px 12px;font:inherit;color:inherit;border:1px solid currentColor;border-radius:10px;background:transparent;cursor:pointer}
.avatar-editor [data-cancel]{border:0;font-size:24px}
.avatar-editor [data-save]{background:#364c66;color:#fff;border-color:#364c66}
.avatar-editor button:disabled{opacity:.45;cursor:default}
.avatar-crop-hint,.avatar-crop-status{margin:12px 0;line-height:1.6}
.avatar-crop-status{min-height:2lh}
.avatar-crop-stage{width:100%;height:min(43dvh,340px);overflow:hidden;background:#0c111a;border-radius:10px}
.avatar-crop-stage>img{display:block;width:100%;height:100%;object-fit:contain}
.avatar-crop-stage cropper-canvas{height:100%;touch-action:none}
.avatar-crop-tools{margin-top:12px}
.avatar-crop-tools[hidden]{display:none}
.avatar-crop-preview{width:64px;height:64px;flex:none;border-radius:50%;overflow:hidden;background:#0c111a;border:1px solid #8291a3}
.avatar-crop-preview cropper-viewer{width:64px;height:64px;display:block}
.avatar-crop-zoom{display:flex;gap:8px}
.avatar-editor :focus-visible,.message-player :focus-visible,.media-fallback :focus-visible{outline:2px solid #7ba2ce;outline-offset:3px}
.media-fallback a{display:inline-block;margin-right:12px}
.message-player{box-sizing:border-box;width:min(100%,320px);padding:8px 0 0;margin-top:9px;border-top:1px solid rgb(120 135 155 / .3);font:12px/1.4 system-ui;color:inherit;user-select:none;touch-action:pan-y}
.message-player-wave-row{display:flex;align-items:center;gap:8px}
.message-player-wave{flex:1;height:36px;min-width:120px;overflow:hidden}
.message-player-controls{display:flex;align-items:center;gap:7px;min-width:0}
.message-player button,.message-player select{font:inherit;color:inherit;background:transparent;border:1px solid rgb(120 135 155 / .5);border-radius:8px;min-width:44px;min-height:44px;padding:5px}
.message-player .message-player-close{flex:none;border:0;padding:5px 6px;opacity:.75;cursor:pointer}
.message-player select{max-width:66px}
.message-player input{flex:1;min-width:35px;width:50px;height:44px;accent-color:#879fbc;margin:0}
.message-player-time{font-variant-numeric:tabular-nums;white-space:nowrap}
.message-player-status{margin:4px 0 0;opacity:.8}
.message-player-status:empty{display:none}
:root[data-theme="snow"] .message-tts.is-playing::after{width:6px;height:8px;border:0;border-left:2px solid #E8EEF7;border-right:2px solid #E8EEF7;border-radius:0;background:transparent;box-shadow:none}
@media(prefers-reduced-motion:reduce){.pswp *{transition-duration:0s!important;animation-duration:0s!important}}
