.rfu-anchor {
  position: relative;
}
.rfu-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.rfu-modal {
  position: absolute;
  z-index: 5;
  display: none;
  min-width: 480px;
  max-width: min(640px, 96%);
  background: var(--dialog-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  color: var(--text-color);
  inset-inline-end: 8px;
  top: 8px;
  pointer-events: auto;
}
.rfu-open {
  display: block;
}

.rfu-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--panel-border);
}
.rfu-seg {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.rfu-label {
  font: 12px/1.2 system-ui;
  color: var(--muted-color);
}
.rfu-select,
.rfu-btn,
.rfu-host {
  font: 12px/1.2 system-ui;
}
.rfu-host {
  display: flex;
  gap: 6px;
  align-items: center;
}
.rfu-host input {
  margin-right: 2px;
}

.rfu-btn {
  padding: 0.4rem 0.6rem;
  background: var(--form-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  color: var(--text-color);
  cursor: pointer;
}
.rfu-btn:hover {
  background: var(--panel-bg-light);
}
.rfu-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
.rfu-select {
  padding: 0.35rem 0.5rem;
  background: var(--form-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  color: var(--text-color);
}

.rfu-drop {
  position: relative;
  min-height: 92px;
  padding: 16px;
  background: var(--panel-bg-light);
}
.rfu-drop::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  pointer-events: none;
}
.rfu-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font: 11px/1.2 system-ui;
  color: var(--muted-color);
}
.rfu-drop.rfu-hover {
  outline: 2px solid var(--primary-color);
  outline-offset: -6px;
}

.rfu-list {
  padding: 8px 12px;
  display: grid;
  gap: 8px;
  background: var(--dialog-bg);
  max-height: 180px;
  overflow: auto;
}
.rfu-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 8px;
  background: var(--form-bg);
}

.rfu-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  object-position: center;
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  image-rendering: auto;
}

.rfu-meta {
  font: 12px/1.35 system-ui;
  color: var(--text-color);
}
.rfu-meta b {
  font-weight: 600;
}
.rfu-actions {
  display: flex;
  gap: 8px;
}
.rfu-actions .rfu-btn--ok {
  background: var(--button-bg);
  border-color: var(--button-bg);
  color: var(--button-text);
}
.rfu-actions .rfu-btn--ok:hover {
  background: var(--button-hover);
  border-color: var(--button-hover);
}

.rfu-progress {
  height: 7px;
  background: #f1f1f1;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.4rem;
}
.rfu-bar {
  height: 100%;
  width: 0%;
  background: var(--primary-color);
  transition: width 0.08s linear;
}

.rfu-list a {
  color: var(--primary-color);
  text-decoration: none;
}
.rfu-list a:hover {
  text-decoration: underline;
}
.rfu-error {
  color: var(--error-color);
  margin-top: 0.35rem;
}

.rfu-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--panel-border);
  background: var(--dialog-bg);
}
.rfu-x {
  margin-left: auto;
  margin-right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rfu-x span {
  font-size: 16px;
  line-height: 1;
}

@media (max-width: 560px) {
  .rfu-item {
    grid-template-columns: 48px 1fr;
  }
  .rfu-actions {
    grid-column: 1/-1;
  }
}
