/* File uploader + image viewer. */
.uploader { display: grid; gap: var(--sp-3); }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2); padding: var(--sp-6);
  border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); color: var(--muted); text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-softer); color: var(--ink-2); }
.dropzone .icon { width: 32px; height: 32px; color: var(--accent); }
.upload-list { display: grid; gap: var(--sp-2); }
.upload-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); padding: var(--sp-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.upload-thumb { width: 48px; height: 48px; border-radius: var(--radius-xs); background: var(--surface-3); display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-meta { font-size: var(--fs-xs); color: var(--muted); }
.upload-item.is-error .upload-meta { color: var(--danger); font-weight: 600; }
.upload-item.is-done .upload-meta { color: var(--success); font-weight: 600; }
.progress { height: 6px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; margin-block-start: 4px; }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.15s; }

/* viewer */
.viewer { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; grid-template-rows: auto 1fr; background: #0b1220; color: #e2e8f0; }
.viewer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); padding: var(--sp-2) var(--sp-3); background: #111a2e; border-block-end: 1px solid #1e293b; }
.viewer-title { font-weight: 700; margin-inline-end: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.viewer-bar .btn { background: transparent; border-color: #334155; color: #e2e8f0; }
.viewer-bar .btn:hover { background: #1e293b; }
.viewer-bar .btn.is-active { background: var(--c-sky); border-color: var(--c-sky); color: #04111f; }
.viewer-bar .sep { width: 1px; height: 24px; background: #334155; margin-inline: var(--sp-1); }
.viewer-bar input[type="color"] { width: 34px; height: 30px; padding: 0; border: 1px solid #334155; border-radius: var(--radius-xs); background: none; }
.viewer-stage { position: relative; overflow: hidden; touch-action: none; cursor: grab; direction: ltr; }
.viewer-stage.is-drawing { cursor: crosshair; }
.viewer-stage.is-panning { cursor: grabbing; }
.viewer-content { position: absolute; inset-block-start: 0; left: 0; transform-origin: 0 0; }
.viewer-content img { display: block; max-width: none; user-select: none; -webkit-user-drag: none; }
.viewer-content canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.viewer-zoom { font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; font-size: var(--fs-sm); }
@media (max-width: 640px) {
  .viewer-title { max-width: 100%; flex-basis: 100%; }
}

/* Phone: the quick-search button collapses to its icon (Ctrl K hint is desktop-only). */
@media (max-width: 640px) {
  .topbar-search-text, .topbar-kbd { display: none; }
  .topbar-search-btn { padding-inline: 8px; }
}
