/* FLUXBOT chat app: Pictures (E1). Prefixes: #imageBtn, .gen-* (BUILD-PLAN §8.11).
   Dark + light themes via the style.css tokens; no animation under prefers-reduced-motion or body.fx-off;
   body.no-images (the kill switch, members only) hides the button. The mode chip and the pressed ring are style.css's. */

body.no-images #imageBtn { display: none !important; }

/* A picture reply: the pictures sit under the text (or alone) */
.gen-box { display: grid; gap: 10px; justify-items: start; margin-top: 10px; }
.turn.ai > .md:empty + .gen-box { margin-top: 0; }
.gen-figure {
  margin: 0; width: min(100%, 420px); border-radius: 16px; overflow: hidden;
  background: var(--surface); border: 1px solid rgba(79, 210, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 32px -18px rgba(30, 144, 255, 0.55);
}
[data-theme="light"] .gen-figure { border-color: rgba(11, 102, 245, 0.18); box-shadow: 0 10px 28px -20px rgba(8, 30, 80, 0.45); }
.gen-open { display: block; width: 100%; padding: 0; border: 0; background: var(--surface-2); cursor: zoom-in; line-height: 0; }
.gen-open img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.gen-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }

.gen-cap { padding: 10px 12px 2px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.gen-tag { display: block; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.gen-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.gen-cap.open .gen-desc { display: block; -webkit-line-clamp: unset; line-clamp: unset; }
.gen-more { min-height: 32px; padding: 0 2px; font-size: 12.5px; font-weight: 600; color: var(--accent); }
[data-theme="light"] .gen-more { color: #0a52c4; }
.gen-more:hover { text-decoration: underline; }

.gen-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px 10px; }
.gen-act {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 13px; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.gen-act:hover { background: var(--hover); border-color: var(--border-strong); }
.gen-act svg { width: 16px; height: 16px; flex: none; }

/* "Painting your picture…": a square placeholder with a soft shimmer (still when motion is reduced or effects are off) */
.gen-working {
  position: relative; display: grid; place-items: center; width: min(100%, 420px); aspect-ratio: 1 / 1;
  border-radius: 16px; overflow: hidden; border: 1px solid var(--border); color: var(--muted); font-size: 14px;
  background: linear-gradient(110deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 250% 100%; animation: genShimmer 1.6s linear infinite;
}
.gen-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 45%, rgba(30, 144, 255, 0.18), transparent 70%);
}
[data-theme="light"] .gen-glow { background: radial-gradient(60% 50% at 50% 45%, rgba(11, 102, 245, 0.1), transparent 70%); }
.gen-wtext { position: relative; padding: 6px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); }
@keyframes genShimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
body.fx-off .gen-working { animation: none; }
@media (prefers-reduced-motion: reduce) { .gen-working { animation: none !important; } }

.gen-gone { padding: 18px 14px; font-size: 13px; color: var(--dim); }
.gen-undo {
  min-height: 36px; padding: 0 2px; font-size: 13px; color: var(--muted); text-decoration: underline;
  text-underline-offset: 2px; text-align: left;
}
.gen-undo:hover { color: var(--text); }

@media (max-width: 768px) {
  .gen-act, .gen-undo { min-height: 40px; }
  .gen-figure, .gen-working { width: 100%; }
}
@media (forced-colors: active) {
  .gen-working { background: Canvas; }
  .gen-act, .gen-figure { border-color: CanvasText; }
}
