/* LoanDesk360 · file upload widget */
#ld-attach-toggle {
  position: fixed;
  bottom: 18px; left: 18px;
  z-index: 67;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 10px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  box-shadow: 0 10px 28px -10px rgba(15,23,42,0.18);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px; font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  transition: all 0.15s;
}
#ld-attach-toggle:hover { transform: translateY(-1px); border-color: #bcd3ff; color: #1d4ed8; }
#ld-attach-toggle svg { width: 18px; height: 18px; color: #2563eb; }
#ld-attach-toggle .ld-attach-count {
  background: #ebf2ff; color: #1d4ed8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
  min-width: 20px; text-align: center;
}
#ld-attach-toggle .ld-attach-label { font-size: 12px; }

#ld-attach-panel {
  position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 95vw;
  background: white;
  border-left: 1px solid #e2e8f0;
  box-shadow: -16px 0 40px -16px rgba(15,23,42,0.15);
  z-index: 71;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; flex-direction: column;
  font-family: 'Inter', system-ui, sans-serif;
  color: #0f172a;
}
#ld-attach-panel.open { transform: translateX(0); }
#ld-attach-panel header {
  padding: 18px 22px;
  border-bottom: 1px solid #e2e8f0;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.ld-attach-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: #64748b; margin-bottom: 4px;
}
#ld-attach-panel header h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
#ld-attach-close {
  width: 30px; height: 30px;
  border-radius: 8px; border: none; background: transparent;
  color: #64748b; cursor: pointer; font-size: 22px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
#ld-attach-close:hover { background: #f1f5f9; color: #0f172a; }

.ld-attach-drop {
  margin: 14px 22px 12px;
  padding: 26px 16px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s;
}
.ld-attach-drop.drag-over { border-color: #2563eb; background: #f5f9ff; transform: scale(1.01); }
.ld-attach-drop-icon { color: #94a3b8; margin-bottom: 8px; }
.ld-attach-drop-icon svg { width: 28px; height: 28px; margin: 0 auto; display: block; }
.ld-attach-drop-text { font-size: 13px; color: #0f172a; font-weight: 500; }
.ld-attach-browse-btn { color: #1d4ed8; font-weight: 700; background: transparent; border: none; cursor: pointer; padding: 0; text-decoration: underline; }
.ld-attach-drop-hint { font-size: 11px; color: #64748b; margin-top: 4px; font-family: 'JetBrains Mono', monospace; }

.ld-attach-list { flex: 1; overflow-y: auto; padding: 4px 0 14px; }
.ld-attach-empty {
  padding: 28px 22px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

.ld-attach-row {
  display: flex; gap: 12px; align-items: center;
  padding: 11px 22px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s;
}
.ld-attach-row:hover { background: #f8fafc; }
.ld-attach-row.ld-attach-uploading { background: #fffbeb; }
.ld-attach-row.ld-attach-failed { background: #fef2f2; }
.ld-attach-row-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: #ebf2ff;
  color: #1d4ed8;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.ld-attach-row-icon svg { width: 18px; height: 18px; }
.ld-attach-row-body { flex: 1; min-width: 0; }
.ld-attach-row-name { font-size: 13px; font-weight: 600; color: #0f172a; word-break: break-word; }
.ld-attach-row-name a { color: #0f172a; text-decoration: none; }
.ld-attach-row-name a:hover { color: #1d4ed8; text-decoration: underline; }
.ld-attach-row-meta { font-size: 11px; color: #64748b; font-family: 'JetBrains Mono', monospace; margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.ld-attach-avatar-mini {
  width: 18px; height: 18px;
  border-radius: 50%;
  color: white; font-weight: 700; font-size: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  letter-spacing: 0.3px;
  margin-right: 2px;
}
.ld-attach-row-action {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #64748b;
  text-decoration: none;
  transition: all 0.15s;
}
.ld-attach-row-action:hover { background: #ebf2ff; color: #1d4ed8; }
.ld-attach-row-action svg { width: 15px; height: 15px; }
.ld-attach-progress { height: 4px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.ld-attach-progress-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #10b981); transition: width 0.3s; }

@media (max-width: 540px) {
  #ld-attach-toggle { bottom: 80px; left: 10px; }
  #ld-attach-panel { width: 100vw; }
}

/* Inline attach button (sits inside .config-toolbar of each module) */
.ld-attach-inline { color: #1d4ed8 !important; }
.ld-attach-inline:hover { background: #ebf2ff !important; color: #1d4ed8 !important; }
.ld-attach-inline svg { color: #2563eb; }
.ld-attach-inline span { display: inline-flex; align-items: center; }
