:root {
  --bg: #1e1e1e;
  --panel: #252526;
  --line: #333;
  --text: #cccccc;
  --muted: #858585;
  --accent: #007acc;
  --ok: #1f8f5f;
  --warn: #c58a00;
  --err: #d43f3a;
}


.topbar {
  padding: 16px 20px 8px;
}
.topbar h1 {
  margin: 0;
  font-size: 22px;
}
.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.env-hint {
  margin: 8px 0 0;
  color: #e6ca84;
  font-size: 12px;
}
.stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 8px 20px 12px;
}
.step {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #252526;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}
.step.active {
  border-color: var(--accent);
  color: var(--accent);
}
.step.done {
  border-color: var(--ok);
  color: var(--ok);
}

.dir-actions button,
.head-tools button {
  background: var(--accent);
  color: #252526;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
}
.head-tools .pick-dir-btn {
  width: 80px;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
  transition: background-color 120ms ease, transform 80ms ease, box-shadow 120ms ease;
}
.dir-actions button:hover,
.head-tools button:hover {
  background: #0e639c;
  box-shadow: 0 2px 8px rgba(31, 111, 235, 0.25);
}
.dir-actions button:disabled,
.head-tools button:disabled {
  background: #555;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.dir-actions button:active,
.head-tools button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(31, 111, 235, 0.2);
}
.head-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-left: auto;
}
.head-tools .refresh-btn {
  background: #252526;
  color: var(--accent);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 8px 10px;
  width: 40px;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
  transition: background-color 120ms ease, transform 80ms ease, box-shadow 120ms ease;
}
.head-tools .refresh-btn:hover {
  background: #2a2d2e;
  box-shadow: 0 2px 8px rgba(31, 111, 235, 0.2);
}
.head-tools .refresh-btn:active {
  transform: translateY(1px);
}
.head-tools .refresh-btn:disabled {
  background: #1e1e1e;
  color: #555;
  border-color: #333;
  cursor: not-allowed;
}
.head-tools .direction-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #2a2d2e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 3px;
}
.head-tools .direction-toggle .direction-label {
  font-size: 12px;
  color: #858585;
  padding: 0 4px 0 2px;
  white-space: nowrap;
}
.head-tools .direction-toggle button {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  color: #858585;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.head-tools .direction-toggle button:hover {
  color: var(--accent);
}
.head-tools .direction-toggle button.active {
  background: #252526;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: #252526;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 6px;
  display: none !important;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
}
.dropdown-menu.open {
  display: flex !important;
}
.dropdown-menu button {
  background: none;
  border: none;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.dropdown-menu button:hover {
  background: #2a2d2e;
  color: var(--accent);
}
.head-tools-btn {
  background: var(--accent);
  color: #252526;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
  transition: background-color 120ms ease, transform 80ms ease, box-shadow 120ms ease;
}
.head-tools-btn:hover {
  background: #0e639c;
  box-shadow: 0 2px 8px rgba(31, 111, 235, 0.25);
}
.head-tools-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(31, 111, 235, 0.2);
}
.dropzone {
  margin-top: 10px;
  border: 1px dashed #333;
  border-radius: 8px;
  padding: 10px;
  color: #858585;
  font-size: 12px;
}
.dropzone.hover {
  background: #2a2d2e;
  border-color: var(--accent);
}
.dir-path {
  margin: 0;
  font-family: Consolas, monospace;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 0 20px 20px;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 190px);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.tree-drop {
  margin: 8px 12px 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  position: relative;
}
.dropzone-hint {
  font-size: 12px;
  color: #858585;
  padding: 2px 4px 8px;
}
.tree-sort-row {
  padding: 0 4px 8px;
}
.sort-select {
  width: 100%;
  height: 32px;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0 8px;
  font-size: 12px;
  color: #cccccc;
  background: #252526;
  outline: none;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.sort-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.15);
}
.sort-select.compact {
  width: auto;
  min-width: 90px;
  height: 30px;
  font-size: 12px;
  padding: 0 6px;
  border-color: #d0dae8;
  background: #252526;
}
.tree-filter-row {
  padding: 0 4px 8px;
}
.tree-filter-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.tree-filter-input {
  width: 100%;
  height: 32px;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0 24px 0 10px;
  font-size: 12px;
  color: #cccccc;
  background: #252526;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  box-sizing: border-box;
}
.tree-filter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.15);
}
.tree-filter-input::placeholder {
  color: #858585;
}
.tree-filter-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #858585;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.tree-filter-input:not(:placeholder-shown) + .tree-filter-clear {
  display: flex;
}
.tree-filter-clear:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #cccccc;
}
.tree-filter-count {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #858585;
  text-align: right;
}
.head-tools .view-toggle {
  display: inline-flex;
  border: 1px solid #333;
  border-radius: 6px;
  overflow: hidden;
}
.head-tools .view-toggle button {
  border: none;
  background: #252526;
  color: #858585;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
  box-shadow: none;
}
.head-tools .view-toggle button.active {
  background: #007acc;
  color: #fff;
}
.head-tools .view-toggle button:hover:not(.active) {
  background: #2a2d2e;
  color: #cccccc;
  box-shadow: none;
}
.tree-drop.loading {
  border-color: #6d97ce;
}
.tree-drop.loading .tree,
.tree-drop.loading .tree-filter-row {
  opacity: 0.45;
  pointer-events: none;
}
.tree-loading {
  position: absolute;
  inset: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed #333;
  border-radius: 8px;
  background: rgba(248, 252, 255, 0.92);
  color: #75beff;
  font-size: 12px;
  z-index: 6;
}
.tree-drop.loading .tree-loading {
  display: flex;
}
.tree-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #333;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: tree-loading-spin 0.8s linear infinite;
}
.tree-loading-text {
  white-space: nowrap;
}
@keyframes tree-loading-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
}
.panel-head-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.panel-head-left .dir-path {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}
  border-bottom: 1px solid var(--line);
}
.panel h3 {
  margin: 0;
  font-size: 14px;
}
.tree {
  padding: 4px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.empty {
  margin: 8px 4px;
  border: 1px dashed #333;
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  color: #858585;
  background: #252526;
  text-align: center;
}
.node {
  border: 1px solid #333;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
  position: relative;
}
.node-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  cursor: pointer;
  transition: background-color 140ms ease;
  position: relative;
  overflow: visible;
}
.node-head.selected {
  background: #094771;
}

.node.side-left .node-head.selected {
  background: linear-gradient(90deg, #094771 0%, #2a2d2e 100%);
}

.node.side-right .node-head.selected {
  background: linear-gradient(90deg, rgba(76, 175, 80, 0.1) 0%, #2a2d2e 100%);
}

.node-head.selected .name {
  font-weight: 700;
}

.node.selected-strong {
  transform: translateY(-1px);
}

.node.side-left.selected-strong {
  border-color: #007acc;
  box-shadow: 0 0 0 2px rgba(47, 120, 255, 0.2), 0 8px 22px rgba(25, 80, 170, 0.12);
}

.node.side-right.selected-strong {
  border-color: #13a26d;
  box-shadow: 0 0 0 2px rgba(19, 162, 109, 0.18), 0 8px 22px rgba(18, 110, 78, 0.12);
}

.node-head.selected::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 999px;
  margin-right: 2px;
}

.node.side-left .node-head.selected::before {
  background: #007acc;
}

.node.side-right .node-head.selected::before {
  background: #13a26d;
}
.toggle {
  width: 18px;
  text-align: center;
  color: #858585;
  flex-shrink: 0;
}
.status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status.pending { background: #a5b2c2; }
.status.done { background: var(--ok); }
.status.failed { background: var(--err); }
.name {
  font-family: Consolas, monospace;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.node-path {
  min-width: 80px;
  flex: 1;
  font-family: Consolas, monospace;
  font-size: 11px;
  color: #858585;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.size-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  font-family: Consolas, monospace;
}
.node-thumb {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #3a3a3a;
  border: 1px solid #555;
  display: flex;
  align-items: center;
  justify-content: center;
}
.node-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.node-thumb .thumb-placeholder {
  color: #858585;
  font-size: 14px;
  line-height: 1;
}
.node-head {
  padding-right: 4px;
}

.node:hover .node-head:not(.selected) {
  background: #252526;
}

.node-actions {
  display: none;
  align-items: center;
  gap: 4px;
  position: absolute;
  right: 4px;
  top: 8px;
  z-index: 10;
  background: #252526;
  padding: 2px 3px;
  border-radius: 6px;
  white-space: nowrap;
  flex-direction: row-reverse;
}

.node:hover .node-actions {
  display: flex;
}
.node-action-btn {
  flex-shrink: 0;
  border: 1px solid #333;
  border-radius: 6px;
  background: #252526;
  color: #cccccc;
  font-size: 11px;
  line-height: 1.2;
  padding: 2px 4px;
  width: 52px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}
.node-action-btn:hover {
  border-color: #007acc;
  background: #2a2d2e;
}
.node-action-btn:disabled {
  border-color: #444;
  color: #666;
  background: #252526;
  cursor: not-allowed;
  opacity: 1;
}
.children {
  border-top: 1px solid #333;
  padding: 6px 8px 8px 34px;
  display: none;
}
.children.open { display: block; }
.child {
  font-family: Consolas, monospace;
  color: #858585;
  font-size: 12px;
  line-height: 1.8;
}

/* Tree view */
.tree-view-tree .folder-tree-root {
  padding: 4px 0;
}
.folder-node {
  margin-bottom: 2px;
}
.folder-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 120ms ease;
}
.folder-head:hover {
  background: #252526;
}
.folder-toggle {
  width: 14px;
  text-align: center;
  color: #858585;
  font-size: 12px;
  flex-shrink: 0;
}
.folder-icon {
  font-size: 13px;
  flex-shrink: 0;
}
.folder-name {
  font-size: 13px;
  color: #cccccc;
  font-weight: 500;
  flex-shrink: 0;
}
.folder-count {
  margin-left: auto;
  font-size: 11px;
  color: #858585;
}
.folder-children {
  padding-left: 18px;
  display: none;
}
.folder-children.open {
  display: block;
}
.tree-view-tree .node {
  margin-bottom: 2px;
  border: none;
  border-radius: 6px;
}
.tree-view-tree .node-head {
  padding: 5px 8px;
}
.tree-view-tree .node-actions {
  top: 4px;
}
.tree-view-tree .node-thumb {
  width: 28px;
  height: 28px;
}

.middle .preview {
  padding: 10px 12px;
  min-height: 300px;
  overflow: auto;
}
.preview ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.preview li {
  font-family: Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
}
.preview li.delete-op {
  color: var(--err);
  font-weight: 700;
}
.warn { color: var(--warn); }

.preview-summary {
  margin: 0;
  color: #cccccc;
  font-size: 13px;
}

.preview-summary-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.preview-summary-sep {
  color: #555;
}

.preview-plan {
  margin-top: 8px;
}

.coverage-box {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #2a2d2e;
  font-size: 12px;
  line-height: 1.6;
}

.coverage-box.ok {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.1);
  color: #81c784;
}

.coverage-box.warn {
  border-color: #e6ca84;
  background: #2525269ec;
  color: #e6ca84;
}

.coverage-box.error {
  border-color: #f48771;
  background: #2525262f2;
  color: #f48771;
}

.coverage-missing {
  margin: 6px 0 0;
  padding-left: 18px;
}

.preview-zoom-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-zoom-label {
  font-size: 12px;
  color: #858585;
  min-width: 56px;
}

.preview-zoom-range {
  flex: 1;
  min-width: 0;
}

.preview-zoom-value {
  font-size: 12px;
  font-family: Consolas, monospace;
  color: #75beff;
  min-width: 42px;
  text-align: right;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.preview-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #252526;
  min-width: 0;
}

.preview-card.left {
  border-color: #b8d1ff;
}

.preview-card.right {
  border-color: #b6e3d0;
}

.preview-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.preview-card-title {
  margin: 0;
  font-size: 13px;
}

.preview-count {
  font-size: 12px;
  color: var(--muted);
}

.preview-select {
  width: 100%;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  color: #cccccc;
  background: #252526;
}

.preview-status-row {
  margin: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.preview-status {
  margin: 0;
  font-size: 11px;
  color: #858585;
  min-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-status.ok {
  color: #1f8f5f;
}

.preview-status.warn {
  color: #a36d00;
}

.preview-status.error {
  color: #bf3c37;
}

.preview-bounds {
  margin: 0;
  font-size: 11px;
  color: #5d6f84;
  white-space: nowrap;
  font-family: Consolas, monospace;
}

.preview-canvas-wrap {
  height: 220px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(73, 144, 255, 0.08), transparent 40%),
    radial-gradient(circle at 80% 85%, rgba(19, 162, 109, 0.08), transparent 45%),
    #2a2d2e;
}

.preview-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.actions {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
}
.actions button {
  flex: 1;
  background: var(--accent);
  color: #252526;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}
.actions button:disabled {
  background: #555;
  cursor: not-allowed;
}

.op-status {
  margin: 0 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-height: 42px;
  display: flex;
  align-items: center;
  font-size: 12px;
  line-height: 1.5;
  color: #858585;
  background: #2a2d2e;
}

.op-status.ok {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.1);
  color: #81c784;
}

.op-status.warn {
  border-color: #e6ca84;
  background: #2525269ec;
  color: #e6ca84;
}

.op-status.error {
  border-color: #f48771;
  background: #2525262f2;
  color: #f48771;
}

.op-status.info {
  border-color: #094771;
  background: #2a2d2e;
  color: #75beff;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .panel {
    min-height: 420px;
    height: auto;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .tree-filter-input {
    font-size: 13px;
  }

}


/* Modal & Batch Replace */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
}
.modal {
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  margin: 0;
  font-size: 15px;
}
.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.modal-close:hover {
  color: var(--text);
}
.modal-body {
  padding: 12px 16px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}
.modal-footer button {
  background: var(--accent);
  color: #252526;
  border: 0;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.modal-footer button:disabled {
  background: #555;
  cursor: not-allowed;
}

.batch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.batch-item {
  border: 1px solid #333;
  border-radius: 8px;
  background: #252526;
  transition: background-color 200ms ease, border-color 200ms ease;
}
.batch-item.success {
  background: rgba(76, 175, 80, 0.1);
  border-color: #4caf50;
}
.batch-item.failed {
  background: #2525262f2;
  border-color: #f48771;
}
.batch-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.batch-item-toggle {
  width: 18px;
  text-align: center;
  color: #858585;
}
.batch-item-name {
  font-family: Consolas, monospace;
  font-size: 13px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batch-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.batch-item-actions button {
  flex-shrink: 0;
  border: 1px solid #333;
  border-radius: 6px;
  background: #252526;
  color: #cccccc;
  font-size: 11px;
  line-height: 1.2;
  padding: 3px 8px;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}
.batch-item-actions button:hover {
  border-color: #007acc;
  background: #2a2d2e;
}
.batch-item-actions .restore-btn {
  border-color: #4caf50;
  color: #81c784;
  background: #252526;
  display: none;
}
.batch-item.success .restore-btn {
  display: inline-block;
}
.batch-item-body {
  border-top: 1px solid #333;
  padding: 8px 10px 10px 36px;
  display: none;
}
.batch-item-body.open {
  display: block;
}
.batch-empty {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 13px;
}

/* ===== Preview Timeline Controls ===== */
.preview-timeline {
  margin-top: 8px;
  padding: 6px 8px;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-timeline-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  color: #858585;
}

.preview-time-current {
  color: #75beff;
  min-width: 62px;
  text-align: right;
}

.preview-time-total {
  color: #858585;
  min-width: 62px;
  text-align: left;
}

.preview-time-sep {
  color: #555;
}

.preview-timeline-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-timeline-btns {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.preview-timeline-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: #2a2d2e;
  border: 1px solid #333;
  border-radius: 5px;
  color: #cccccc;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.preview-timeline-btn:hover {
  background: #37373d;
  border-color: #007acc;
}

.preview-timeline-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #333;
}

.preview-timeline-track-wrap {
  flex: 1;
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
}

.preview-timeline-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: transparent;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  position: relative;
  z-index: 2;
  margin: 0;
}

.preview-timeline-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  background: #007acc;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 120ms ease;
}

.preview-timeline-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.preview-timeline-range:disabled {
  cursor: not-allowed;
}

.preview-timeline-range:disabled::-webkit-slider-thumb {
  background: #555;
}

.preview-timeline-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: #007acc;
  border-radius: 2px;
  width: 0%;
  z-index: 1;
  pointer-events: none;
}
