.files-entry { display:flex; align-items:center; gap:9px; margin:0 16px 14px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; text-align:left; }
.files-entry span { margin-left:auto; font-size:10px; color:var(--muted); }
.files-dialog, .files-editor { color:var(--ink); background:var(--paper); border:1px solid var(--line); border-radius:22px; box-shadow:0 24px 90px #293a3129; }
.files-dialog::backdrop,.files-editor::backdrop { background:#172b2366; backdrop-filter:blur(3px); }
.files-dialog { width:min(1040px,calc(100vw - 48px)); max-height:calc(100dvh - 48px); padding:28px; overflow:auto; }
.files-dialog [hidden],.files-editor [hidden] { display:none !important; }
.files-header { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.files-header h2 { font-size:26px; margin:8px 0 20px; }
.files-button { border:1px solid var(--line); border-radius:10px; padding:8px 15px; background:#fffefa; }
.files-button.primary { background:var(--green); border-color:var(--green); color:white; }
.files-toolbar { display:flex; flex-wrap:wrap; gap:8px; }
.files-status { min-height:20px; color:#9b493a; margin:12px 0; overflow-wrap:anywhere; }
.files-crumbs { display:flex; flex-wrap:wrap; align-items:center; gap:8px; border-top:1px solid var(--line); padding-top:10px; }
.files-crumbs button { max-width:100%; overflow-wrap:anywhere; text-align:left; }
.files-crumbs button:last-child { font-weight:700; }
.files-usage,.files-hint { color:#687468; font-size:12px; line-height:1.7; overflow-wrap:anywhere; }
.files-list { border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.files-row { display:grid; grid-template-columns:minmax(130px,1fr) 80px auto; gap:10px; align-items:center; padding:10px 14px; border-bottom:1px solid var(--line); }
.files-row:last-child { border-bottom:0; }
.files-name { text-align:left; font-weight:600; overflow-wrap:anywhere; min-width:0; }
.files-meta { font-size:12px; color:#687468; }
.files-actions { display:flex; flex-wrap:wrap; gap:3px; font-size:12px; }
.files-actions button { padding:8px; border-radius:8px; }
.files-actions button:hover,.files-crumbs button:hover { background:#eff2e9; }
.files-empty { padding:35px 20px; text-align:center; color:#687468; line-height:1.8; }
.files-detail { margin-top:20px; padding:18px; border:1px solid var(--line); border-radius:14px; background:#f7f8f2; }
.files-detail-heading { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; }
.files-detail-heading h3 { margin:10px 0 15px; overflow-wrap:anywhere; min-width:0; }
.files-detail-heading button { flex-shrink:0; }
.files-preview-image { display:block; max-width:100%; max-height:60vh; margin:auto; object-fit:contain; }
.files-preview-text { white-space:pre-wrap; overflow-wrap:anywhere; max-height:60vh; overflow:auto; font-size:13px; padding:15px; background:white; border-radius:10px; }
.files-editor { width:min(480px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); padding:26px; overflow:auto; }
.files-editor h3 { margin:0 0 20px; }
.files-fields,.files-share-form { display:grid; gap:16px; }
.files-fields label,.files-share-form label,.files-link-result label { display:grid; gap:8px; font-size:13px; font-weight:600; min-width:0; }
.files-fields input,.files-fields select,.files-share-form input,.files-share-form select,.files-link-result input { width:100%; min-width:0; min-height:44px; padding:10px; border:1px solid #d9ded2; border-radius:8px; color:var(--ink); background:#fffefa; font:inherit; }
.files-form-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:20px; }
.files-form-error { color:#9b493a; line-height:1.6; }
.files-share-form { grid-template-columns:1fr 1fr; }
.files-share-form label:has(#files-share-base) { grid-column:1 / -1; }
.files-share-form>button { justify-self:start; }
.files-link-result:not(:empty) { padding:16px; margin-top:18px; border:1px solid #cbd9bc; background:#eef4e5; border-radius:10px; }
.files-link-result>button { margin-top:12px; }
.files-share-row { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:8px 0; border-top:1px solid var(--line); font-size:12px; }
.files-share-row span { overflow-wrap:anywhere; }
.files-share-row button { flex-shrink:0; }
@media(max-width:700px) {
 .files-dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); padding:18px 14px; border-radius:16px; }
 .files-header h2 { font-size:23px; }
 .files-toolbar { gap:6px; }
 .files-toolbar button { flex:1 0 40%; }
 .files-row { grid-template-columns:minmax(0,1fr) auto; gap:2px 8px; padding:10px; }
 .files-actions { grid-column:1 / -1; justify-content:flex-start; gap:6px; }
 .files-actions button { min-height:44px; }
 .files-detail { padding:12px; }
 .files-share-form { grid-template-columns:1fr; }
 .files-editor { padding:22px; }
}

.files-drop-hint {
  margin: 12px 0 0;
  padding: 13px 16px;
  border: 1px dashed #cbd6bd;
  border-radius: 10px;
  color: #6b7d60;
  background: #f7f9f2;
  font-size: 13px;
  line-height: 1.5;
}
.files-drag-active {
  outline: 3px solid #7b9666;
  outline-offset: -4px;
}
.files-drag-active .files-drop-hint {
  border-color: #718d5b;
  background: #e9f0df;
  color: #354e2b;
}

.files-page-drop-hint {
  position: fixed;
  inset: 16px;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 3px dashed #7b9666;
  border-radius: 18px;
  background: #f1f6e9ed;
  color: #354e2b;
  font-size: 20px;
  text-align: center;
  pointer-events: none;
}
.files-page-drop-hint[hidden] { display: none; }
