.dropbox-page {
  max-width: 1100px;
  margin: 0 auto;
}

.dropbox-dropzone {
  position: relative;
  border: 2px dashed #c7d2fe;
  border-radius: 12px;
  background: #f8fafc;
  padding: 24px 16px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
  user-select: none;
}
.dropbox-dropzone:hover,
.dropbox-dropzone:focus {
  background: #eef2ff;
  border-color: #6366f1;
  outline: none;
}
.dropbox-dropzone.is-dragover {
  background: #e0e7ff;
  border-color: #4f46e5;
  transform: scale(1.005);
}
.dropbox-dropzone .dropbox-icon {
  font-size: 2.25rem;
  color: #6366f1;
  line-height: 1;
}

.dropbox-table th,
.dropbox-table td {
  vertical-align: middle;
}
.dropbox-col-check { width: 36px; }
.dropbox-col-thumb { width: 64px; }
.dropbox-col-name { min-width: 200px; word-break: break-all; }

.dropbox-thumb {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.dropbox-thumb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 1.25rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.dropbox-name-link {
  color: #1e293b;
  text-decoration: none;
  font-weight: 500;
}
.dropbox-name-link:hover { text-decoration: underline; }

.dropbox-row-share { margin-left: 4px; }
.dropbox-row-save { margin-right: 4px; }
.dropbox-row-save svg { vertical-align: -2px; }

/* 브레드크럼(현재 폴더 위치) */
.dropbox-breadcrumb {
  font-size: 0.9rem;
  color: #475569;
}
.dropbox-breadcrumb .dropbox-crumb-link {
  color: #4f46e5;
  text-decoration: none;
}
.dropbox-breadcrumb .dropbox-crumb-link:hover { text-decoration: underline; }
.dropbox-breadcrumb .dropbox-crumb-sep { margin: 0 8px; color: #cbd5e1; }
.dropbox-breadcrumb .dropbox-crumb-current { font-weight: 600; color: #1e293b; }

/* 파일 행 — 빈 영역 클릭으로도 선택 토글이 되므로 행 전체가 클릭 대상.
   table-hover가 셀 배경을 덮어쓰므로 선택 강조도 td에 직접 지정한다. */
.dropbox-table tbody tr[data-path] { cursor: pointer; }
.dropbox-table tbody tr.dropbox-row-selected > td { background-color: #eef2ff; }
.dropbox-table tbody tr.dropbox-row-selected:hover > td { background-color: #e0e7ff; }

/* 폴더 행 — 항상 목록 위쪽, 배경은 희미한 밝은 노란색.
   table-hover가 셀 배경을 덮어쓰므로 td에 직접 지정한다. */
.dropbox-folder-row > td { background-color: #fffdf0; }
.dropbox-folder-row:hover > td { background-color: #fff8db; }
.dropbox-thumb-folder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
  font-size: 1.4rem;
  background: #fff7ed;
  border: 1px solid #fde9c8;
}
.dropbox-folder-link {
  color: #1e293b;
  text-decoration: none;
  font-weight: 600;
}
.dropbox-folder-link:hover { text-decoration: underline; color: #4f46e5; }

@media (max-width: 575.98px) {
  .dropbox-dropzone { padding: 18px 12px; }
  .dropbox-thumb { width: 40px; height: 40px; }
  .dropbox-col-thumb { width: 52px; }
}

/* standalone(홈 화면 앱) 모드 파일 미리보기 모달 */
.dropbox-preview[hidden] { display: none !important; }
.dropbox-preview {
  position: fixed;
  inset: 0;
  z-index: 10500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
.dropbox-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.dropbox-preview-panel {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 14px;
  width: min(96vw, 1000px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
}
.dropbox-preview-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.dropbox-preview-title {
  flex: 1 1 auto;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dropbox-preview-close {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  font-size: 1.15rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dropbox-preview-close:hover { background: rgba(0, 0, 0, 0.06); color: #0f172a; }
.dropbox-preview-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: #0f172a;
}
.dropbox-preview-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  background: #000;
  border-radius: 8px;
}
.dropbox-preview-video,
.dropbox-preview-audio {
  max-width: 100%;
  border-radius: 8px;
  background: #000;
}
.dropbox-preview-video { max-height: 75vh; }
.dropbox-preview-frame {
  width: 100%;
  height: 75vh;
  border: 0;
  background: #fff;
  border-radius: 8px;
}
.dropbox-preview-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 4px 0 2px;
}
body.dropbox-preview-open { overflow: hidden; }

/* 정렬 컨트롤 (ROOT 우측: 이름/날짜 select + 오름/내림 화살표 버튼) */
.dropbox-sort .dropbox-sort-key {
  width: auto;
  min-width: 92px;
  font-weight: 600;
}
.dropbox-sort .dropbox-sort-dir {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
