/* ── File listing ───────────────────────────────────── */
#listing { display: flex; flex-direction: column; }

/* Listing header (resizable columns) */
.listing-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  border-bottom: 2px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  user-select: none;
  flex-shrink: 0;
}
.header-name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  position: relative;
}
.header-name.has-width { flex: none; }
.header-size {
  width: 70px;
  text-align: right;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.header-date {
  width: 130px;
  text-align: left;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  position: relative;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  user-select: none;
}
.header-date.has-width { flex: none; }
.header-actions {
  width: 80px;
  text-align: center;
  flex-shrink: 0;
}
.header-path {
  display: flex;
  align-items: center;
  position: relative;
  flex-shrink: 0;
  width: 200px;
  min-width: 60px;
}

/* Column resizer — sits at the left edge of the column it belongs to */
.resizer {
  position: absolute;
  left: -5px;
  top: 0;
  bottom: 0;
  width: 10px;
  cursor: col-resize;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.resizer::after {
  content: '';
  display: block;
  width: 2px;
  height: 60%;
  background: transparent;
  border-radius: 1px;
  transition: background 0.15s;
}
.resizer:hover::after,
.resizer.resizing::after {
  background: var(--accent);
}

/* File rows */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  position: relative;
}
.row:hover { background: var(--hover); }
.row.up-row { color: var(--muted); min-height: var(--row-h); }
.row.up-row .row-icon svg { width: 18px; height: 18px; }
.row.dragover {
  background: var(--hover);
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}
.row-icon { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.row-icon svg { width: 16px; height: 16px; display: block; }
.row-name {
  flex: 1;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  scrollbar-width: none;
  min-width: 0;
}
.row-name.has-width { flex: none; }
.row-name:hover {
  overflow: auto hidden;
  text-overflow: clip;
}
.row-name::-webkit-scrollbar { display: none; }
.row-size {
  color: var(--muted);
  font-size: 12px;
  width: 70px;
  text-align: right;
  flex-shrink: 0;
}
.row-date {
  width: 130px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-date.has-width { flex: none; }
.row-actions { visibility: hidden; display: flex; gap: 6px; width: 80px; flex-shrink: 0; justify-content: center; }
.row:hover .row-actions { visibility: visible; }
.row-actions button {
  padding: 2px 6px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  border-radius: 3px;
  cursor: pointer;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.row-actions button svg {
  width: 12px;
  height: 12px;
  display: block;
}
.row-actions .del { color: var(--danger); }

/* Audio badge on rows */
.row-audio .row-icon { color: #89b4fa; position: relative; }

/* Inline play button for audio rows */
.row-play-btn {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s, background 0.15s, color 0.15s;
  z-index: 2;
  pointer-events: none;
}
.row-audio:hover .row-play-btn {
  opacity: 1;
  pointer-events: auto;
}
.row-play-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-50%) scale(1.1);
}
.row-play-btn.playing {
  opacity: 1;
  pointer-events: auto;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Image badge on rows */
.row-image .row-icon { color: #34d399; }

.empty { color: var(--muted); padding: 24px 8px; text-align: center; }