#nuwa-local-image-file {
  position: fixed;
  width: 1px;
  height: 1px;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
}
[data-local-image-action="choose"] {
  cursor: pointer;
  transition: border-color 150ms, background-color 150ms;
}
[data-local-image-action="choose"]:hover,
[data-local-image-dragging="true"] {
  border-color: var(--nuwa-fg-muted);
  background-color: var(--nuwa-bg-subtle);
}
[data-local-image-action]:focus-visible {
  outline: 2px solid var(--nuwa-fg);
  outline-offset: 4px;
}
#nuwa-local-image-preview {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 42rem;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--nuwa-border);
  background: var(--nuwa-bg-subtle);
  color: var(--nuwa-fg);
}
#nuwa-local-image-preview[hidden] { display: none; }
[data-local-image-steps][hidden] { display: none !important; }
#nuwa-local-image-preview img {
  width: min(40%, 220px);
  max-height: 180px;
  object-fit: contain;
}
.local-image-info { flex: 1; min-width: 0; }
.local-image-name { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.local-image-details { margin-top: 6px; font-size: 12px; color: var(--nuwa-fg-muted); }
.local-image-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.local-image-actions button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--nuwa-border);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.local-image-actions button:hover { background: var(--nuwa-bg-elevated); }
.local-image-actions button:disabled { cursor: wait; opacity: .55; }
.local-image-actions button[data-local-image-action="search"] {
  background: var(--nuwa-fg);
  color: var(--nuwa-bg);
}
#nuwa-local-image-status {
  width: 100%;
  max-width: 42rem;
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--nuwa-fg-muted);
}
#nuwa-local-image-status[data-error="true"] { color: #dc4646; }
#nuwa-local-image-status a, #nuwa-local-image-results a { text-decoration: underline; text-underline-offset: 3px; }
#nuwa-local-image-results { width: 100%; max-width: 52rem; margin-top: 32px; text-align: left; color: var(--nuwa-fg); }
#nuwa-local-image-results[hidden] { display: none; }
.local-image-result-header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.local-image-result-header h3 { font-size: 20px; font-weight: 600; }
.local-image-result-header a, .local-image-result-source { font-size: 12px; color: var(--nuwa-fg-muted); }
.local-image-result-source { margin-top: 8px; }
#nuwa-local-image-results h4 { font-size: 14px; font-weight: 600; margin: 28px 0 12px; }
.local-image-source-list article { display: flex; align-items: start; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--nuwa-border); }
.local-image-source-list article > a { flex: 0 0 104px; }
.local-image-source-list article > div { min-width: 0; }
.local-image-source-list img { width: 104px; height: 76px; object-fit: contain; background: var(--nuwa-bg-subtle); }
#nuwa-local-image-results article a { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
#nuwa-local-image-results article p { margin-top: 6px; font-size: 12px; line-height: 1.6; color: var(--nuwa-fg-muted); overflow-wrap: anywhere; }
.local-image-similar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 20px 16px; }
.local-image-similar-grid article { min-width: 0; }
.local-image-similar-grid img { width: 100%; height: 120px; object-fit: contain; margin-bottom: 8px; background: var(--nuwa-bg-subtle); }
.local-image-thumbnail-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 120px; margin-bottom: 8px; border: 1px solid var(--nuwa-border); color: var(--nuwa-fg-muted); }
#nuwa-local-image-results a:focus-visible { outline: 2px solid var(--nuwa-fg); outline-offset: 3px; }
@media (max-width: 767px) {
  #nuwa-local-image-preview { gap: 12px; margin-top: 0; padding: 12px; }
  #nuwa-local-image-preview img { max-height: 140px; }
  .local-image-actions { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-local-image-action] { transition: none; }
}
