.docs-library { max-width: 1100px; color: var(--text-primary); }
.docs-library [hidden] { display: none !important; }
.docs-toolbar, .docs-card-footer, .docs-card-heading, .docs-file-heading,
.docs-actions, .docs-dialog header, .docs-dialog footer {
  display: flex;
  align-items: center;
  gap: 12px;
}
.docs-toolbar, .docs-card-footer, .docs-file-heading { justify-content: space-between; }
.docs-toolbar { margin: 26px 0 20px; }
.docs-search { display: flex; align-items: center; gap: 10px; width: 320px; max-width: 100%; }
.docs-search, .docs-field input {
  border: 1px solid var(--surface-300);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
}
.docs-search input { min-width: 0; width: 100%; background: transparent; }
.docs-count { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.docs-list { display: grid; gap: 14px; }
.docs-card { padding: 22px; border: 1px solid var(--surface-200); border-radius: 12px; background: var(--surface-50); }
.docs-card-heading { align-items: flex-start; margin-bottom: 22px; }
.docs-card h2 { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.docs-file-icon { border: 1px solid var(--surface-200); border-radius: 8px; padding: 6px 10px; color: var(--accent); background: var(--surface); }
.docs-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--surface-300);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.docs-button:hover { background: var(--surface-100); }
.docs-button:disabled { opacity: .45; }
.docs-primary { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.docs-primary:hover { background: var(--accent-dim); }
.docs-danger, .docs-error { color: var(--signal-red); }
.docs-language { color: var(--accent); font-size: 12px; }
.docs-small { padding: 4px 8px; font-size: 12px; }
.docs-icon { padding: 4px 10px; font-size: 22px; border-color: transparent; }
.docs-muted { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.docs-help { margin: 12px 0; }
.docs-actions { flex-wrap: wrap; }
.docs-notification { padding: 12px 16px; border: 1px solid var(--surface-300); border-radius: 8px; margin-bottom: 16px; }
.docs-notification:not(.docs-error) { color: var(--accent); background: var(--accent-muted); }
.docs-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(470px, 100%);
  height: 100dvh;
  max-height: 100dvh;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--surface-200);
  background: var(--surface);
  color: var(--text-primary);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.docs-dialog::backdrop { background: #0f172a66; }
.docs-dialog header { justify-content: space-between; padding: 24px; }
.docs-dialog h2 { font-size: 19px; font-weight: 600; }
.docs-dialog h3 { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.docs-dialog-body { padding: 0 24px 24px; }
.docs-dialog footer { border-top: 1px solid var(--surface-200); padding: 20px 24px; }
.docs-field { display: grid; gap: 7px; font-size: 12px; margin: 16px 0; }
.docs-field input { width: 100%; min-width: 0; color: var(--text-primary); font-size: 14px; }
.docs-preview { display: grid; gap: 8px; padding: 14px; background: var(--surface-50); border: 1px solid var(--surface-200); border-radius: 8px; }
.docs-library code { display: block; font-size: 11px; overflow-wrap: anywhere; white-space: normal; }
.docs-section-heading { margin: 24px 0 12px; }
.docs-file { padding: 16px 0; border-bottom: 1px solid var(--surface-200); }
.docs-file code { margin: 9px 0 5px; }
.docs-upload-details { margin: 12px 0; }
.docs-upload-details summary { font-size: 13px; color: var(--accent); padding: 8px 0; cursor: pointer; }
.docs-drop { display: grid; gap: 10px; border: 1px dashed var(--surface-300); background: var(--surface-50); padding: 20px; border-radius: 8px; font-size: 14px; margin: 18px 0; }
.docs-drop input { width: 100%; min-width: 0; font-size: 12px; }
.docs-empty { color: var(--text-muted); padding: 30px 0; }
.docs-library input:focus-visible, .docs-library button:focus-visible,
.docs-library a:focus-visible, .docs-library summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 640px) {
  .docs-toolbar { flex-wrap: wrap; }
  .docs-search { width: 100%; }
  .docs-card { padding: 16px; }
  .docs-card-footer { align-items: flex-start; flex-wrap: wrap; }
  .docs-card-footer > .docs-actions { width: 100%; }
  .docs-dialog header, .docs-dialog footer { padding: 20px 16px; }
  .docs-dialog-body { padding: 0 16px 20px; }
  .docs-field input { font-size: 16px; }
}
@media (pointer: coarse) {
  .docs-button, .docs-upload-details summary { min-height: 44px; }
}
