/* ─── 리셋 & 기본 ────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --bg3: #22253a;
  --border: #2e3250;
  --accent: #6c63ff;
  --accent-hover: #7d75ff;
  --accent2: #00d4aa;
  --danger: #ff4b6e;
  --danger-hover: #ff6383;
  --text: #e8eaf0;
  --text-muted: #888ba8;
  --selected-bg: rgba(108, 99, 255, 0.18);
  --selected-border: rgba(108, 99, 255, 0.5);
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --font: 'Segoe UI', 'Noto Sans KR', system-ui, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.5;
}

/* ─── 헤더 ──────────────────────────────────────────────────────────────── */

.app-header {
  background: linear-gradient(135deg, #1a1d27 0%, #16192e 100%);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.app-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
}

.subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

/* ─── 메인 ──────────────────────────────────────────────────────────────── */

.app-main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ─── 패널 ──────────────────────────────────────────────────────────────── */

.panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.panel h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* ─── 가져오기 패널 (2열) ───────────────────────────────────────────────── */

.import-panel {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.import-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.import-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  flex-shrink: 0;
}

.import-col--thumb {
  flex: 0 0 auto;
  min-width: 180px;
  max-width: 240px;
}

.thumb-check-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
}

.thumb-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  user-select: none;
}

.thumb-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.thumb-info {
  font-size: 11px;
  color: var(--accent2);
}

.thumb-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .import-panel {
    flex-direction: column;
  }

  .import-divider {
    width: 100%;
    height: 1px;
  }
}

/* ─── 드롭존 ────────────────────────────────────────────────────────────── */

.dropzone {
  display: block;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg);
  outline: none;
}

.dropzone:hover,
.dropzone:focus,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.06);
}

.dropzone-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.dropzone-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
}

.dropzone-text strong {
  color: var(--text);
}

.dropzone-sub {
  font-size: 12px;
}

.dropzone-sub code {
  background: var(--bg3);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 11px;
  color: var(--accent2);
}

/* ─── 툴바 ──────────────────────────────────────────────────────────────── */

.toolbar-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── 버튼 ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg3);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn:hover {
  background: #2a2e47;
  border-color: #3d4170;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn.secondary {
  background: var(--accent2);
  border-color: var(--accent2);
  color: #000;
  font-weight: 600;
}

.btn.secondary:hover {
  background: #00bfa0;
  border-color: #00bfa0;
}

.btn.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.btn.danger:hover {
  background: rgba(255, 75, 110, 0.12);
}

.btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn.active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  opacity: 0.7;
  transition: opacity 0.15s;
}

.btn-icon:hover {
  opacity: 1;
  background: var(--bg3);
}

/* ─── 검색 ──────────────────────────────────────────────────────────────── */

.search-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 10px;
  width: 200px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--accent);
}

.game-count {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ─── 게임 테이블 ───────────────────────────────────────────────────────── */

.list-panel {
  padding: 0;
  overflow: hidden;
}

/* ─── 게임 목록 필터 바 ──────────────────────────────────────────────────── */

.list-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-wrap: wrap;
}

.list-filter-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.list-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.list-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.list-filter-chip:hover {
  background: var(--bg3);
  color: var(--text);
}

.list-filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  max-height: 480px;
  overflow-y: auto;
}

.game-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.game-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg3);
}

.game-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.game-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(46, 50, 80, 0.6);
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}

.game-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.game-table tbody tr.selected {
  background: var(--selected-bg);
  border-left: 2px solid var(--accent);
}

.game-table tbody tr.rom-matched .col-path {
  color: var(--text);
}

.game-table tbody tr.rom-missing .col-path {
  color: #444;
}

.col-num {
  width: 50px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.col-name {
  width: 45%;
}

.col-path {
  color: var(--text-muted);
  font-family: monospace;
  font-size: 12px;
}

.col-thumb {
  width: 52px;
  text-align: center;
  padding: 4px 8px !important;
}

.thumb-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}

.thumb-upload-btn {
  font-size: 18px;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.4;
  display: block;
  margin: 0 auto;
  padding: 2px;
  transition: opacity 0.15s;
}

.thumb-upload-btn:hover {
  opacity: 1;
}

.col-actions {
  width: 50px;
  text-align: center;
}

.empty-msg {
  text-align: center;
  color: var(--text-muted);
  padding: 40px !important;
  font-size: 14px;
}

/* ─── 내보내기 ──────────────────────────────────────────────────────────── */

.export-options {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 240px;
}

.field-label--narrow {
  flex: 0 0 auto;
  min-width: 140px;
  max-width: 180px;
}

.field-label span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.text-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: monospace;
  font-size: 12px;
  padding: 7px 10px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}

.text-input:focus {
  border-color: var(--accent);
}

.export-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  flex-basis: 100%;
}

.export-batch-row {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.export-batch-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.export-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.export-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  flex: 2 1 0;
  min-width: 0;
}

.export-card--compact {
  flex: 1.5 1 0;
  gap: 10px;
  padding: 14px 12px;
}

.export-card-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.export-card-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.export-card-info strong {
  font-size: 14px;
}

.export-card-info span {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

/* ─── 상태 메시지 ───────────────────────────────────────────────────────── */

.status {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  max-width: 400px;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 100;
}

.status:empty {
  display: none;
}

.status.success {
  background: #1a3a2e;
  border: 1px solid #2d6651;
  color: #4fffb0;
}

.status.error {
  background: #3a1a22;
  border: 1px solid #6e2d3e;
  color: #ff7090;
}

.status.warn {
  background: #2e2a12;
  border: 1px solid #6e5e1a;
  color: #ffd166;
}

/* ─── 편집 다이얼로그 ───────────────────────────────────────────────────── */

.edit-dialog {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 24px;
  min-width: 420px;
  box-shadow: var(--shadow);
}

.edit-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.edit-dialog h3 {
  margin-bottom: 16px;
  font-size: 16px;
}

.edit-dialog form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-dialog label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.edit-dialog input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.2s;
}

.edit-dialog input:focus {
  border-color: var(--accent);
}

.thumb-edit-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label-text {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.thumb-edit-zone {
  width: 100%;
  min-height: 140px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}

.thumb-edit-zone:hover,
.thumb-edit-zone.drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.thumb-edit-preview {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  display: block;
}

.thumb-edit-placeholder {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
  padding: 16px;
  pointer-events: none;
}

.thumb-img-info {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.3px;
  min-height: 1em;
}

.ss-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 2px;
}

.ss-search-note {
  font-size: 11px;
  color: var(--text-muted);
}

.ss-dialog {
  width: 440px;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}
.ss-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}
.ss-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.ss-dialog-header h4 {
  margin: 0;
  font-size: 15px;
}
.ss-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  padding: 0 4px;
}
.ss-close-btn:hover {
  color: var(--text);
}
.ss-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ss-rom-name {
  margin: 0;
  font-size: 13px;
}
.ss-open-link {
  text-align: center;
  text-decoration: none;
}
.ss-instructions {
  background: var(--bg);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13px;
}
.ss-instructions ol {
  margin: 0;
  padding-left: 18px;
}
.ss-instructions li {
  margin-bottom: 6px;
  line-height: 1.5;
}
.ss-instructions li:last-child {
  margin-bottom: 0;
}
.ss-paste-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.edit-dialog label small {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}

/* ─── 폴더 다중 선택 다이얼로그 ─────────────────────────────────────── */

.folder-picker-dialog {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-width: 380px;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.folder-picker-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.folder-picker-dialog h3 {
  font-size: 16px;
  margin: 0;
}

.folder-picker-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

.folder-picker-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-height: 48px;
}

.folder-picker-empty {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.folder-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.folder-picker-item:last-child {
  border-bottom: none;
}

.folder-picker-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-folder-btn {
  flex-shrink: 0;
  font-size: 12px;
  opacity: 0.6;
}

.remove-folder-btn:hover {
  opacity: 1;
}

.folder-picker-add {
  display: flex;
}

.naming-mode-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 2px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.naming-mode-label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.naming-mode-option {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg3);
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}

.naming-mode-option:has(input:checked) {
  background: #5550cc;
  border-color: #5550cc;
  color: #fff;
}

.naming-mode-option input {
  display: none;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

/* ─── 이미지 자동 검색 다이얼로그 (라이트 테마) ─────────────────────── */

.auto-search-dialog {
  background: #f8f9fb;
  border: 1px solid #c8cad4;
  border-radius: var(--radius);
  padding: 24px;
  min-width: 660px;
  max-width: 960px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  color: #1a1c2e;
}

.auto-search-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.auto-search-dialog h3 {
  font-size: 16px;
  margin: 0;
  color: #111320;
}

.auto-search-summary {
  font-size: 14px;
  color: #444660;
  margin: 0;
}

.auto-search-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #d0d2de;
  font-size: 13px;
  color: #333550;
}

.auto-search-ctrl-label {
  white-space: nowrap;
}

.filter-group {
  display: flex;
  gap: 6px;
  flex: 1;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  border: 1px solid #c0c2d8;
  border-radius: 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #444666;
  background: #fff;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  user-select: none;
}

.filter-label:has(input:checked) {
  background: #5550cc;
  border-color: #5550cc;
  color: #fff;
}

.filter-label input {
  display: none;
}

.auto-search-selected-count {
  font-size: 12px;
  font-weight: 600;
  color: #5550cc;
  background: #ededff;
  padding: 2px 10px;
  border-radius: 10px;
}

.auto-search-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.auto-search-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 6px;
  border-bottom: 1px solid #e2e4ef;
  cursor: pointer;
  font-size: 14px;
  color: #1a1c2e;
}

.auto-search-item:hover {
  background: #eef0fb;
}

.auto-search-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: #1a1c2e;
}

.auto-search-path {
  font-size: 11px;
  color: #6668a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  flex-shrink: 0;
}

.candidate-count-badge {
  font-size: 11px;
  font-weight: 700;
  color: #5550cc;
  background: #dddeff;
  padding: 1px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.match-item.has-candidates {
  border-bottom: none;
}

.candidate-list {
  list-style: none;
  padding: 2px 0 8px 28px;
  margin: 0;
  border-bottom: 1px solid #e2e4ef;
}

.candidate-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #333550;
}

.candidate-item:hover {
  background: #e8eaf8;
}

.candidate-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid #c8cad8;
  background: #fff;
}

.candidate-path {
  font-size: 11px;
  color: #6668a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auto-search-dialog .dialog-actions {
  border-top: 1px solid #d0d2de;
  padding-top: 12px;
  margin-top: 0;
}

/* ─── 프로그레스 다이얼로그 ────────────────────────────────────────────── */

.prefix-dialog {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  min-width: 360px;
  max-width: 480px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.prefix-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}

.prefix-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prefix-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.prefix-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.progress-dialog {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  min-width: 360px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.progress-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}

.progress-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  appearance: none;
  border: none;
  overflow: hidden;
}

.progress-bar::-webkit-progress-bar {
  background: var(--bg3);
  border-radius: 4px;
}

.progress-bar::-webkit-progress-value {
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.15s ease;
}

/* 인디케이터 — 전체 길이를 모를 때 좌우 슬라이드 애니메이션 */
.progress-bar:indeterminate {
  background: linear-gradient(90deg,
      var(--bg3) 0%,
      var(--bg3) 30%,
      var(--accent) 50%,
      var(--bg3) 70%,
      var(--bg3) 100%);
  background-size: 200% 100%;
  animation: progress-slide 1.4s linear infinite;
}

@keyframes progress-slide {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: -100% 0;
  }
}

.progress-status {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  min-height: 1em;
}

/* ─── 하위 폴더 선택 다이얼로그 ─────────────────────────────────────────── */

.subfolder-select-dialog {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  min-width: 340px;
  max-width: 520px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.subfolder-select-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}

.subfolder-select-dialog h4 {
  font-size: 15px;
  margin: 0;
}

.subfolder-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.subfolder-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-y: auto;
  max-height: 40vh;
}

.subfolder-list li {
  border-bottom: 1px solid var(--border);
}

.subfolder-list li:last-child {
  border-bottom: none;
}

.subfolder-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}

.subfolder-list label:hover {
  background: var(--bg3);
}

/* ─── 이미지 자동 정리 다이얼로그 ──────────────────────────────────────── */

.cleanup-confirm-dialog {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-width: 380px;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.cleanup-confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.cleanup-confirm-dialog h3 {
  font-size: 16px;
  margin: 0;
}

.cleanup-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

.cleanup-desc strong {
  color: var(--text);
}

.cleanup-select-all {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.cleanup-file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-y: auto;
  max-height: 40vh;
}

.cleanup-file-list li {
  border-bottom: 1px solid var(--border);
}

.cleanup-file-list li:last-child {
  border-bottom: none;
}

.cleanup-file-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
}

.cleanup-file-list label:hover {
  background: var(--bg3);
}

.cleanup-filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

/* ─── 푸터 ──────────────────────────────────────────────────────────────── */

.app-footer {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 16px 24px;
}

.app-footer details {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.app-footer summary {
  padding: 12px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
}

.app-footer summary:hover {
  color: var(--text);
}

.help-content {
  padding: 0 18px 16px;
}

.help-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-content li {
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 12px;
  border-left: 2px solid var(--border);
  line-height: 1.6;
}

.help-content li strong {
  color: var(--text);
}

.help-content code {
  background: var(--bg3);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--accent2);
}

.note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-copy {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-copy a {
  color: var(--accent2);
  text-decoration: none;
}

.footer-copy a:hover {
  text-decoration: underline;
}

/* ─── 반응형 ────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .toolbar-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .search-input {
    flex: 1;
  }

  .export-card {
    min-width: 100%;
  }

  .edit-dialog {
    min-width: 90vw;
  }
}