[hidden] { display: none !important; }
.document-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 22px 0; }
.document-thumb { min-width: 0; padding: 8px; border: 1px solid var(--line); background: var(--cream); color: var(--ink); text-align: left; transition: border-color .15s; }
.document-thumb:hover { border-color: var(--copper); }
.document-thumb img { width: 100%; aspect-ratio: 1 / 1.414; object-fit: contain; background: white; }
.document-thumb > span { display: block; padding: 8px 2px 2px; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.document-pdf-icon { display: grid !important; place-items: center; min-height: 140px; background: #eae7de; color: var(--forest); font-size: 25px !important; font-weight: 600; }
.field-help { margin: -10px 0 16px; color: var(--muted); font-size: 13px; }
.attachment-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.attachment-preview-item { min-width: 0; margin-bottom: 18px; padding: 8px; border: 1px solid var(--line); overflow-wrap: anywhere; font-size: 13px; }
.attachment-preview-item img { width: 100%; height: 110px; object-fit: contain; background: white; margin-bottom: 6px; }
.attachment-preview-item .document-pdf-icon { min-height: 110px; }
.attachment-preview-item span { display: block; }
.attachment-remove { display: block; margin-top: 5px; padding: 4px 0; border: 0; background: transparent; color: var(--copper); font-size: 13px; text-decoration: underline; }
#clear-attachments { align-self: flex-start; margin-bottom: 20px; }
.form-status button { margin-left: 10px; border: 0; background: transparent; color: var(--copper); text-decoration: underline; }
.document-dialog { width: min(96vw, 1080px); height: min(94vh, 1100px); max-height: 94vh; padding: 0; border: 0; background: var(--paper); color: var(--ink); }
.document-dialog::backdrop { background: rgba(17, 29, 23, .8); }
.document-topline { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 20px; background: var(--forest); color: white; }
.document-topline h2 { min-width: 0; margin: 0; font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.document-topline .editor-close { min-width: 36px; min-height: 36px; }
.document-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 64px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.document-toolbar button, .document-toolbar a { min-height: 38px; padding: 6px 12px; border: 1px solid #bfc5bd; background: var(--cream); color: var(--forest); text-decoration: none; font-size: 14px; }
.document-toolbar button:disabled { opacity: .4; cursor: default; }
#document-counter { font-size: 14px; }
#document-download { margin-left: auto; }
.document-stage { height: calc(100% - 130px); padding: 18px; overflow: auto; background: #deded5; }
.document-stage img { width: auto; height: auto; max-width: 100%; max-height: 100%; margin: 0 auto; background: white; }
.document-stage.is-zoomed img { width: auto; max-width: none; max-height: none; min-width: 100%; margin: 0; }
.document-stage object { display: block; width: 100%; height: 100%; min-height: 400px; background: white; }
.pdf-open-link { display: block; padding: 10px 12px; margin-bottom: 10px; background: var(--cream); color: var(--forest); font-size: 14px; text-underline-offset: 3px; }
.news-card { border-top: 1px solid var(--line); }
@media (max-width: 650px) {
  .document-gallery { gap: 8px; }
  .document-thumb { padding: 4px; }
  .document-thumb > span { font-size: 12px; }
  .attachment-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-dialog { width: 100vw; max-width: 100vw; height: 96vh; max-height: 96vh; }
  .document-topline { padding: 12px; }
  .document-topline h2 { font-size: 15px; }
  .document-toolbar { gap: 7px; padding: 8px; }
  .document-toolbar button, .document-toolbar a { padding-inline: 8px; font-size: 13px; }
  .document-stage { padding: 8px; height: calc(100% - 150px); }
}
