/* Picture editor (editor.js), in the synthwave look: dark stage, neon pink frame and buttons, JetBrains Mono labels. */
html.editor-open, html.editor-open body { overflow: hidden; overscroll-behavior: none; }
.img-editor { position: fixed; inset: 0; z-index: 20; background: #0b0614; color: var(--sw-fg, #f6e9f6); opacity: 0; transition: opacity .16s;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
.img-editor.shown { opacity: 1; }
.ed-stage { position: absolute; inset: 0; touch-action: none; }
.ed-canvas { width: 100%; height: 100%; display: block; }
.img-editor[data-mode="draw"] .ed-stage { cursor: crosshair; }
.ed-top, .ed-bottom { position: absolute; left: 0; right: 0; display: flex; pointer-events: none; }
.ed-top > *, .ed-bottom > * { pointer-events: auto; }
.ed-top { top: 0; align-items: center; gap: 6px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  background: linear-gradient(rgba(11, 6, 20, .92), rgba(11, 6, 20, .55)); }
.ed-title { flex: 1; }
.ed-bottom { bottom: 0; flex-direction: column; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(11, 6, 20, .55), rgba(11, 6, 20, .94)); border-top: 1px solid rgba(255, 79, 216, .25); }
.ed-btn { min-width: 44px; height: 44px; border-radius: 22px; border: 1px solid rgba(109, 86, 134, .6); background: rgba(43, 29, 58, .85);
  color: var(--sw-fg, #f6e9f6); font-size: 20px; display: grid; place-items: center; padding: 0 10px; }
.ed-word { font-family: var(--mono, monospace); font-size: 13.5px; letter-spacing: .3px; }
.ed-btn:disabled { opacity: .35; }
.ed-btn:not(:disabled):active, .ed-btn.ed-on { border-color: var(--sw-magenta, #ff4fd8); color: var(--sw-bmagenta, #ff8ff0);
  box-shadow: 0 0 0 1px rgba(255, 79, 216, .35), 0 0 16px rgba(255, 45, 149, .35); text-shadow: 0 0 8px rgba(255, 45, 149, .6); }
.ed-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ed-crop-tools { justify-content: center; }
.img-editor[data-mode="draw"] .ed-crop-tools, .img-editor[data-mode="crop"] .ed-tools:not(.ed-crop-tools) { display: none; }
.ed-colors, .ed-sizes { display: flex; align-items: center; gap: 8px; }
.ed-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255, 244, 251, .7); background: var(--c); padding: 0; }
.ed-swatch.ed-on { border-color: #fff4fb; box-shadow: 0 0 0 3px var(--sw-cursor, #ff2d95), 0 0 14px rgba(255, 45, 149, .7); transform: scale(1.08); }
.ed-size { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(109, 86, 134, .6); background: rgba(43, 29, 58, .85); display: grid; place-items: center; padding: 0; }
.ed-size::after { content: ""; width: var(--d); height: var(--d); border-radius: 50%; background: var(--c, #ff3560); }
.ed-size.ed-on { border-color: var(--sw-magenta, #ff4fd8); box-shadow: 0 0 0 1px rgba(255, 79, 216, .35), 0 0 14px rgba(255, 45, 149, .4); }
.ed-strip { display: flex; gap: 8px; overflow-x: auto; touch-action: pan-x; padding: 2px; }
.ed-strip[hidden] { display: none; }
.ed-thumb { flex: none; width: 50px; height: 50px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: #000; opacity: .65; }
.ed-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-thumb.ed-on { border-color: var(--sw-magenta, #ff4fd8); opacity: 1; box-shadow: 0 0 12px rgba(255, 45, 149, .5); }
.ed-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ed-link { border: 0; background: none; color: var(--sw-cyan, #2ef0f0); font-family: var(--mono, monospace); font-size: 13.5px; padding: 10px 4px; text-decoration: underline; text-underline-offset: 3px; }
.ed-done { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--sw-cursor, #ff2d95); color: var(--sw-bg, #150e1e); font-size: 26px; font-weight: 700;
  box-shadow: 0 0 0 2px rgba(255, 143, 240, .5), 0 0 22px rgba(255, 45, 149, .65); }
.ed-done:disabled, .ed-link:disabled { opacity: .5; }
.img-editor.ed-busy .ed-done { animation: ed-pulse .8s ease-in-out infinite alternate; }
@keyframes ed-pulse { to { box-shadow: 0 0 0 2px rgba(255, 143, 240, .8), 0 0 34px rgba(255, 45, 149, .95); } }
.ed-toast { position: fixed; left: 16px; right: 16px; top: calc(70px + env(safe-area-inset-top)); z-index: 21; margin: 0 auto; max-width: 420px; padding: 10px 14px;
  border-radius: 12px; background: var(--sw-black, #2b1d3a); border: 1px solid var(--sw-magenta, #ff4fd8); color: var(--sw-fg, #f6e9f6); font-size: 14px; text-align: center; }
@media (hover: hover) and (pointer: fine) {
  .ed-btn:not(:disabled):hover, .ed-size:hover { border-color: var(--sw-magenta, #ff4fd8); }
  .ed-link:hover { color: var(--sw-bcyan, #7dfffd); }
}

/* Picture attachments in the composer: thumbnails, tap to edit again. */
.att-thumb { position: relative; width: 58px; height: 58px; padding: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--sw-magenta, #ff4fd8);
  background: #000; box-shadow: 0 0 10px rgba(255, 45, 149, .3); }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-thumb .att-edit { position: absolute; left: 3px; bottom: 3px; font-size: 11px; line-height: 1; padding: 2px 4px; border-radius: 6px; background: rgba(11, 6, 20, .75); }
.att-thumb.uploading img { opacity: .75; }
.att-thumb.uploading::after { content: "⏳"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; }
.att-wrap { position: relative; display: inline-flex; }
.att-wrap .chip-x { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; padding: 0; background: var(--sw-black, #2b1d3a);
  border: 1px solid var(--sw-magenta, #ff4fd8); color: var(--sw-fg, #f6e9f6); font-size: 11px; display: grid; place-items: center; }
.att-thumb.uploading:has(.att-pct:not(:empty))::after { content: none; }
