/* Four-photo posts reuse the square's reading layout and theme tokens. */
.compose-photos{margin:14px 0 22px;--image-line:var(--border,#30343b);--image-soft:var(--surface-2,#202329)}
.compose-photos>header{display:flex;align-items:center;justify-content:space-between;margin:0 0 13px;font-size:13px;color:var(--text)}
.compose-photos>header small,.compose-photo-tip{font-size:11px;color:var(--muted)}
.compose-photo-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:min(100%,328px)}
.compose-photo-preview{position:relative;aspect-ratio:1;min-width:0;border-radius:16px;overflow:hidden;background:var(--image-soft);border:1px solid var(--image-line)}
.compose-photo-preview>img{display:block;width:100%;height:100%;object-fit:cover}
body.ui-polished .compose-photo-preview>button{position:absolute;right:6px;top:6px;display:grid;place-items:center;width:44px;height:44px;min-height:44px;padding:11px;border:1px solid #ffffff45;border-radius:50%;background:#102033b8;color:#fff;box-shadow:none!important;translate:none;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.compose-photo-preview>button svg,.compose-photo-add svg,.community-image-viewer button svg{display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
body.ui-polished .compose-photo-add{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;aspect-ratio:1;min-height:112px;margin:0;padding:12px;border:1px dashed var(--image-line);border-radius:16px;background:var(--image-soft);color:var(--muted);font:inherit;font-size:12px;box-shadow:none!important;translate:none}
.compose-photo-add svg{width:29px;height:29px;stroke-width:1.3}
.compose-photos button:disabled{opacity:.45;cursor:default}
#compose-photo-status{min-height:0;font-size:11px;line-height:1.7;color:var(--muted);margin:10px 0 5px;overflow-wrap:anywhere}
#compose-photo-status:empty{display:none}
.compose-photo-tip{display:block;margin-top:10px;line-height:1.7}
body #community-publish-form textarea{min-height:160px;max-height:45vh}
.community-post-images{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;width:min(calc(100% - 47px),320px);margin:13px 0 15px 47px;min-width:0}
.community-post-images.image-count-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.community-post-images.image-count-1{grid-template-columns:minmax(0,1fr);width:min(calc(100% - 47px),300px)}
body.ui-polished .community-post-images>button{display:block;min-width:0;width:100%;aspect-ratio:1;margin:0;padding:0;overflow:hidden;border:0;border-radius:11px;background:transparent;cursor:zoom-in;box-shadow:none!important;translate:none;line-height:0}
.community-post-images>button>img{display:block;width:100%;height:100%;object-fit:cover;max-width:100%}
body.ui-polished .community-post-images.image-count-1>button{width:fit-content;max-width:100%;min-height:0;aspect-ratio:auto;max-height:none}
.community-post-images.image-count-1>button>img{width:auto;height:auto;max-width:100%;max-height:330px;object-fit:cover}
body .community-post>.community-post-open:empty,.post-detail-body:empty{display:none!important}
.post-detail-article>.community-post-images{margin:20px 0 23px;width:min(100%,420px)}
.post-detail-article>.community-post-images.image-count-1{width:min(100%,380px)}
.community-image-viewer{padding:5px 0 0;min-width:0;color:var(--text)}
.community-image-viewer>header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-right:28px;margin:4px 0 20px}
.community-image-viewer h2{font-size:18px;font-weight:600;line-height:1.5;margin:0}
.community-image-position{font-size:11px;color:var(--muted);white-space:nowrap}
.community-image-stage{display:flex;align-items:center;justify-content:center;min-height:140px;max-height:65vh;max-height:65dvh;border-radius:15px;overflow:hidden;background:var(--surface-2,#202329)}
.community-image-stage>img{display:block;width:auto;height:auto;max-width:100%;max-height:65vh;max-height:65dvh;object-fit:contain}
.community-image-stage>[hidden]{display:none!important}
.community-image-error{font-size:12px;line-height:1.8;color:var(--muted);padding:20px;text-align:center}
.community-image-viewer>footer{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:15px}
.community-image-viewer>footer[hidden]{display:none}
.community-image-viewer>footer>span{font-size:11px;color:var(--muted)}
body.ui-polished .community-image-viewer>footer>button{display:grid;place-items:center;width:44px;height:44px;min-height:44px;padding:9px;border:1px solid var(--border,#30343b);border-radius:13px;background:var(--surface-2,#202329);color:var(--text);box-shadow:none!important;translate:none}
.community-image-viewer button:disabled{opacity:.3;cursor:default}
.compose-photos button:focus-visible,.community-post-images>button:focus-visible,.community-image-viewer button:focus-visible{outline:2px solid var(--accent,#3478ed);outline-offset:3px}
:root[data-theme="light"] .compose-photos{--image-line:#dae4f0;--image-soft:#f3f6fb}
:root[data-theme="light"] .community-image-stage,:root[data-theme="light"] .community-image-viewer>footer>button{background:#f3f6fb;border-color:#dae4f0}
@media(max-width:360px){.community-post-images,.community-post-images.image-count-1{margin-left:0;width:min(100%,300px)}.compose-photo-grid{gap:8px}.compose-photo-preview,.compose-photo-add{border-radius:13px}.community-post-images>button{border-radius:9px}}
@media(prefers-reduced-motion:reduce){.compose-photos *,.community-post-images *,.community-image-viewer *{transition:none!important}}
