/* Screenshots in rich text: one image, four fixed sizes. A cap, never a width, so a small
   crop is not stretched and the column still bounds it. Large (450px) is the default (bare class) and shrinks to the column. */
.rt-shot{
  display:inline-block; height:auto; max-width:min(100%, 450px); vertical-align:top;
  border-radius:6px; border:1px solid var(--border-soft); background:var(--panel-2);
}
/* Legacy names stay readable: -m and -s are Large (the base), -xs is Medium. */
.rt-shot-m, .rt-shot-s{ max-width:min(100%, 450px); }
.rt-shot-xs, .rt-shot-2{ max-width:min(100%, 338px); }
.rt-shot-3{ max-width:min(100%, 252px); }
.rt-shot-4{ max-width:min(100%, 189px); }
/* Read-only images open full size on click (the shared layer launcher); the pointer says so. */
.rt-shot.is-viewable, .rt-shot[role="button"]{ cursor:zoom-in; }
/* A selected image in edit mode: the accent outline, offset so it clears the border. */
.rt-shot.sel, .rt-shot[data-shot-selected]{ outline:2px solid var(--accent); outline-offset:2px; }
.rt-shot:focus-visible{ outline:var(--a-focus, 2px solid var(--focus-ring)); outline-offset:var(--a-focus-offset, 2px); }
/* Not yet fetched: the same dashed panel as the upload placeholder, pulsing slowly, at the stored size. */
img.rt-shot[data-shot-state="loading"]{
  border:1px dashed var(--border); background:var(--panel-2); animation:rt-shot-pulse 1.6s ease-in-out infinite;
}
img.rt-shot[data-shot-state="loaded"]{ animation:rt-shot-in 160ms ease-out; }
/* Cannot be fetched (removed, or no access): a quiet placeholder. No min-size: it would beat the size cap. */
img.rt-shot[data-shot-state="unavailable"]{
  border:1px solid var(--border); background:var(--panel-2); cursor:default;
}
@keyframes rt-shot-pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.55; } }
@keyframes rt-shot-in{ from{ opacity:0; } to{ opacity:1; } }
@media (prefers-reduced-motion: reduce){
  img.rt-shot[data-shot-state="loading"]{ animation:none; }
  img.rt-shot[data-shot-state="loaded"]{ animation:none; }
}
/* The upload placeholder: uploading is a quiet status line, failed reads as an error with its two actions. */
.rt-shot-pending{
  display:inline-flex; flex-wrap:wrap; align-items:center; gap:8px; margin:4px 0; padding:6px 10px;
  border:1px dashed var(--border); border-radius:6px; background:var(--panel-2); color:var(--text-dim); font-size:var(--a-fs-12);
}
.rt-shot-pending-text{ line-height:var(--a-lh-ui); }
.rt-shot-pending[data-state="failed"]{ border-style:solid; border-color:var(--red); background:var(--red-soft); color:var(--red); }
/* Comments lay images out as blocks, so the margin holds. */
.cmt-thread .rt-shot{ display:block; margin:6px 0; }
/* The Size button is 26px tall with a mouse and --a-ctl under a coarse pointer (a touch target: 32px, 34px at the narrow width, DS-04). */
@media (pointer:coarse){ .a-fmt-b[data-rt="shotmenu"]{ height:var(--a-ctl); } }
