/*
 * The document vault (views/documents.ts) and the manual editor in the firearm page's filed
 * panel (views/filed.ts). Linked from app/index.html after styles.css; everything else those
 * views use (.panel, .kv, .chips, .filed*, .section-rule, .table-wrap) lives there.
 */

/* Kind filter: one chip per kind, the active one in brass, counts in mono. */
.doc-chips {
  margin: -6px 0 18px;
}
.doc-chips .chip {
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  border-radius: 0;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}
.doc-chips .chip:hover,
.doc-chips .chip.brass {
  border-color: var(--brass);
  color: var(--brass);
  box-shadow: 0 0 12px var(--glow);
}
.doc-chips .chip .count {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
  color: var(--muted);
}
.doc-chips .chip.brass .count {
  color: var(--brass);
}

/* The filed table: the Open action sits at the right edge of its row. */
.doc-table td:last-child {
  text-align: right;
  white-space: nowrap;
}

/* An empty vault: the message and its action, centered. */
.doc-empty p {
  margin: 0 auto 6px;
  max-width: 520px;
}
.doc-empty .actions {
  justify-content: center;
}

/* Image documents show inline; PDFs open in their own tab. */
.doc-preview {
  margin-bottom: 20px;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-align: center;
}
.doc-preview img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 70vh;
}

/* The firearm page's filed panel: links into the vault, and the inline manual editor. */
.filed-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  font-size: 13px;
}
.filed-edit {
  flex: 1;
  min-width: 0;
  padding: 6px 0;
}
