/* Stijlen voor /bestanden en /lezer (gebruikt de variabelen uit styles.css). */
.files-main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
.files-main h1, .reader-title { font-family: var(--serif); font-weight: 500; margin: 6px 0 8px; }
.files-intro { color: var(--text-soft); max-width: 70ch; }
.files-filter { width: 100%; max-width: 420px; margin: 16px 0; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--field-line); border-radius: 6px; }
.files-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.file-card { display: block; height: 100%; padding: 14px 16px; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; }
.file-card:hover, .file-card:focus-visible { border-color: var(--blue); }
.file-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.file-card h2 { font-size: 17px; margin: 6px 0; line-height: 1.3; color: var(--ink); }
.file-card p { margin: 0; font-size: 14px; color: var(--text-soft); }
.file-orig { margin-top: 8px !important; font-size: 12px !important; font-family: var(--mono); color: var(--muted) !important; word-break: break-word; }
.file-badge { padding: 1px 6px; border: 1px solid var(--field-line); border-radius: 4px; }

main.reader-main { width: 100%; max-width: none; min-height: 0; margin: 0; padding: 0 10px 40px; }
.reader-top .guide-back { margin: 0; white-space: nowrap; }
.reader-top { position: sticky; top: 0; z-index: 5; display: flex; gap: 16px; align-items: center; padding: 8px 4px; background: var(--paper); border-bottom: 1px solid var(--rule); }
.reader-title { font-family: var(--serif); font-size: 18px; flex: 1; text-align: left; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-pos { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.reader-sub { color: var(--muted); font-size: 12px; word-break: break-word; margin: 6px 4px 10px; }
.reader-tabs { display: none; gap: 8px; margin-bottom: 10px; }
.reader-tabs button { font-family: var(--mono); font-size: 13px; padding: 7px 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--field-line); border-radius: 6px; cursor: pointer; }
.reader-tabs button[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.page-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: start; margin-bottom: 16px; }
.scan-cell { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 4px; }
.scan-cell canvas { display: block; width: 100%; height: auto; }
.scan-msg { padding: 24px 16px; color: var(--text-soft); text-align: center; }
/* De rij is zo hoog als de scan; langere tekst scrolt binnen het tekstvak. */
.page-row { min-height: 40vh; align-items: stretch; }
.text-cell { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; }
.text-inner { position: absolute; inset: 0; overflow-y: auto; padding: 18px 22px; }
.text-cell .page-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.text-cell .page-body { white-space: pre-wrap; font-size: 17px; line-height: 1.65; color: var(--text-body); }
.text-cell .page-note { display: block; font-family: var(--mono); font-size: 13px; color: var(--muted); }

@media (max-width: 820px) {
  .reader-tabs { display: flex; }
  .page-row { grid-template-columns: 1fr; min-height: 0; }
  .text-cell { min-height: 60vh; }
  .text-inner { position: static; }
  .reader-split[data-tab="scan"] .text-cell, .reader-split[data-tab="tekst"] .scan-cell { display: none; }
  .files-grid { grid-template-columns: 1fr; }
}
.report-btn { margin-left: auto; font: inherit; font-family: var(--mono); font-size: 12px; padding: 3px 8px; color: var(--text-soft); background: transparent; border: 1px solid var(--field-line); border-radius: 4px; cursor: pointer; }
.report-btn:hover { color: var(--ink); border-color: var(--blue); }
.report-edit { display: block; width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; line-height: 1.6; color: var(--text-body); background: var(--field); border: 1px solid var(--blue); border-radius: 4px; padding: 10px; resize: vertical; }
.report-edit[hidden], .page-body[hidden] { display: none; }
.suggestion-btn { margin-left: 8px; color: var(--blue); border-color: var(--blue); }
.suggestion-btn + .report-btn { margin-left: 8px; }
.text-cell .page-body.is-suggestion { border-left: 3px solid var(--blue); padding-left: 12px; }
.browse-link { display: block; max-width: 450px; margin-top: 16px; padding: 12px 16px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--blue); border-radius: 6px; }
.browse-link[hidden] { display: none; }
.browse-link:hover, .browse-link:focus-visible { border-color: var(--blue); }
.browse-label { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.browse-link strong { font-weight: 500; font-size: 15px; line-height: 1.4; }

/* Feedbackknop en -venster (feedback.js) */
.fb-open { position: fixed; right: 16px; bottom: 16px; z-index: 20; font-family: var(--mono); font-size: 12px; padding: 8px 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--blue); border-radius: 999px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.fb-open:hover { background: var(--blue); color: #fff; }
.fb-dialog { width: min(480px, calc(100vw - 32px)); padding: 20px; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; }
.fb-dialog::backdrop { background: rgba(0,0,0,.5); }
.fb-form h2 { font-family: var(--serif); font-weight: 500; margin: 0 0 12px; }
.fb-form label { display: block; margin-bottom: 12px; font-size: 14px; color: var(--text-soft); }
.fb-form select, .fb-form textarea, .fb-form input[name="contact"] { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 8px; font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--field-line); border-radius: 4px; }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fb-status { min-height: 1.4em; margin: 0 0 8px; font-size: 14px; color: var(--text-soft); }
.fb-actions { display: flex; gap: 8px; justify-content: flex-end; }
.fb-actions button { font: inherit; font-size: 14px; padding: 7px 14px; color: var(--ink); background: transparent; border: 1px solid var(--field-line); border-radius: 6px; cursor: pointer; }
.fb-actions .fb-send { color: #fff; background: var(--blue); border-color: var(--blue); }
.fb-actions button:disabled { opacity: .6; }
.file-card-off { opacity: .65; cursor: default; }
.file-card-off:hover { border-color: var(--rule); }
.file-nope { margin-top: 8px !important; font-size: 13px !important; font-style: italic; }

/* Zoekresultaat: "open pdf-deel" en "naast scan lezen" onder elkaar op dezelfde plek in het raster. */
.result-actions { grid-column: 2; grid-row: 2 / span 2; align-self: center; display: flex; flex-direction: column; gap: 8px; }
.result-actions .result-link { grid-column: auto; grid-row: auto; margin: 0; }
@media (max-width: 820px) {
  .result-actions { grid-column: 1; grid-row: auto; flex-direction: row; flex-wrap: wrap; margin-top: 5px; }
}
.viewer-page-head .scan-link-gap, .viewer-page-head .result-link + .result-link { margin-left: 8px; }
.result-actions .result-link { display: flex; }

/* Alle kaarten even hoog; lange teksten worden afgekapt (volledige naam staat in de tooltip). */
.files-grid { grid-auto-rows: 1fr; }
.file-card h2 { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.file-card p:not(.file-orig) { display: -webkit-box; -webkit-line-clamp: 5; line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.file-orig { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Zoeken binnen een bestand (lezer) */
.doc-search { position: relative; flex: 0 1 320px; }
.doc-search input { width: 100%; box-sizing: border-box; padding: 7px 10px; font: inherit; font-size: 14px; color: var(--ink); background: var(--field); border: 1px solid var(--field-line); border-radius: 6px; }
.doc-results { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: min(560px, 92vw); max-height: 60vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.doc-results[hidden] { display: none; }
.doc-msg { margin: 0; padding: 10px 14px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-hit { display: flex; gap: 10px; width: 100%; padding: 9px 14px; text-align: left; font: inherit; font-size: 14px; color: var(--text-body); background: transparent; border: 0; border-top: 1px solid var(--rule); cursor: pointer; }
.doc-hit:hover, .doc-hit:focus-visible { background: var(--answer-bg); }
.doc-hit strong { flex: none; font-family: var(--mono); font-size: 12px; color: var(--accent); min-width: 44px; }
@media (max-width: 820px) { .reader-top { flex-wrap: wrap; } .doc-search { flex: 1 1 100%; order: 5; } }
.doc-results { left: auto; right: 0; }
@media (max-width: 820px) { .doc-results { right: auto; left: 0; } }
.file-card h2 { -webkit-line-clamp: 2; line-clamp: 2; }
.file-card p:not(.file-orig) { -webkit-line-clamp: 4; line-clamp: 4; }
