/* explorer */

/* ---------- toolbar rows ---------- */
.app.explorer .app-toolbar { flex-wrap: wrap; row-gap: 6px; }
.app.explorer .ex-toolbar-2 { border-top: 1px solid rgba(0,60,150,0.12); }
.app.explorer .ex-search { width: 170px; height: 28px; padding: 0 10px; font-size: 0.8rem; }
.app.explorer .ex-sort { height: 30px; padding: 0 8px; font-size: 0.8rem; }
.app.explorer .ex-viewtoggle { display: flex; gap: 4px; }
.app.explorer .ex-preview-btn.active,
.app.explorer .ex-viewtoggle button.active { background: linear-gradient(180deg, #a9ecff, #3aa8ff 48%, #0f7de8 52%, #0b5fd6); color: #fff; text-shadow: 0 -1px 0 rgba(0,40,120,0.6); }

/* ---------- 3-column body: sidebar / main / preview ---------- */
.app.explorer .explorer-body { flex: 1; min-height: 0; display: flex; }
.app.explorer .ex-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app.explorer .app-content { padding: 10px; }

.app.explorer .ex-sidebar {
  flex: none; width: 172px; overflow-y: auto; padding: 8px 6px;
  background: linear-gradient(180deg, rgba(230,244,255,0.55), rgba(210,234,255,0.35));
  border-right: 1px solid rgba(0,60,150,0.15);
}
.app.explorer .ex-place {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px;
  cursor: pointer; user-select: none; margin-bottom: 2px;
}
.app.explorer .ex-place img { width: 20px; height: 20px; object-fit: contain; flex: none; }
.app.explorer .ex-place-name { flex: 1; min-width: 0; font-size: 0.82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app.explorer .ex-place-count { font-size: 0.72rem; opacity: 0.65; font-weight: 600; }
.app.explorer .ex-place:hover { background: rgba(140,205,255,0.35); }
.app.explorer .ex-place.active { background: linear-gradient(180deg, rgba(140,205,255,0.8), rgba(60,150,255,0.65)); color: #fff; text-shadow: 0 1px 1px rgba(0,30,90,0.5); }
.app.explorer .ex-place.drop-target { background: rgba(125,220,43,0.45); outline: 2px dashed #4fa30f; outline-offset: -2px; }

.app.explorer .ex-preview {
  display: none; flex: none; width: 220px; overflow-y: auto; padding: 14px;
  border-left: 1px solid rgba(0,60,150,0.15);
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(220,240,255,0.45));
}
.app.explorer .ex-preview.open { display: block; }
.app.explorer .ex-preview-icon { display: flex; justify-content: center; margin-bottom: 10px; }
.app.explorer .ex-preview-icon img { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0,20,80,0.3)); }
.app.explorer .ex-preview-img { width: 100%; border-radius: 10px; border: 2px solid #fff; box-shadow: 0 4px 12px rgba(0,40,120,0.25); margin-bottom: 10px; display: block; }
.app.explorer .ex-preview-name { font-weight: 700; font-size: 0.9rem; word-break: break-word; margin-bottom: 6px; text-align: center; }
.app.explorer .ex-preview-meta { font-size: 0.78rem; opacity: 0.75; text-align: center; line-height: 1.5; }
.app.explorer .ex-preview-text { font: 500 0.78rem/1.4 var(--font); white-space: pre-wrap; word-break: break-word; background: rgba(255,255,255,0.6); border-radius: 8px; padding: 8px; margin: 0 0 8px; max-height: 220px; overflow: hidden; }

/* ---------- item states shared by grid/list ---------- */
.app.explorer .file-item.drop-target { background: rgba(125,220,43,0.45); outline: 2px dashed #4fa30f; outline-offset: -2px; }

/* ---------- list view ---------- */
.app.explorer .file-list-head,
.app.explorer .file-item.row {
  display: grid; grid-template-columns: minmax(0,1fr) 100px 90px 140px; gap: 6px; align-items: center;
}
.app.explorer .file-list-head { padding: 4px 10px 6px; font-size: 0.74rem; font-weight: 700; opacity: 0.7; border-bottom: 1px solid rgba(0,60,150,0.15); position: sticky; top: 0; background: rgba(235,246,255,0.92); z-index: 1; }
.app.explorer .file-list-head span { cursor: pointer; user-select: none; white-space: nowrap; }
.app.explorer .file-list-head span:hover { color: #0b5fd6; }
.app.explorer .file-item.row { padding: 5px 10px; border-radius: 8px; text-align: left; }
.app.explorer .file-item.row .cell-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.app.explorer .file-item.row .cell-name img { width: 24px; height: 24px; object-fit: contain; flex: none; }
.app.explorer .file-item.row.image .cell-name img { object-fit: cover; border-radius: 4px; border: 1px solid #fff; }
.app.explorer .file-item.row .item-name { font-size: 0.82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app.explorer .file-item.row .cell-type,
.app.explorer .file-item.row .cell-size,
.app.explorer .file-item.row .cell-date { font-size: 0.76rem; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app.explorer .file-item.row.selected .cell-type,
.app.explorer .file-item.row.selected .cell-size,
.app.explorer .file-item.row.selected .cell-date { opacity: 1; }
.app.explorer .file-item.row input.rename { width: 100%; }

/* ---------- properties dialog ---------- */
.ex-props table { border-collapse: collapse; width: 100%; }
.ex-props th { text-align: left; padding: 4px 12px 4px 0; font-size: 0.82rem; opacity: 0.7; white-space: nowrap; vertical-align: top; }
.ex-props td { padding: 4px 0; font-size: 0.82rem; font-weight: 600; word-break: break-word; }

/* ---------- trash ---------- */
.app.trash .file-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.app.trash .file-item { position: relative; }
.app.trash .trash-item-btns { display: flex; flex-direction: column; gap: 4px; width: 100%; margin-top: 4px; }
.app.trash .app-btn.small { height: 24px; padding: 0 8px; font-size: 0.72rem; width: 100%; justify-content: center; }

/* ---------- text editor ---------- */
.app.textview textarea { overflow-wrap: break-word; }
