﻿.resource-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 20px 0; }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.resource-card { border: 1px solid #d9dfe7; border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; overflow-wrap: anywhere; }
.resource-card img { width: 100%; height: 140px; object-fit: contain; background: #f5f7fa; }
.resource-id { font-family: monospace; font-size: 11px; }
.resource-insert-actions { position: sticky; bottom: 0; padding: 12px 0; background: var(--surface, white); }
.material-picker { width: min(1000px, 94vw); max-width: 1000px; max-height: 88vh; overflow-y: auto; }
.material-list-row { padding: 16px 0; border-bottom: 1px solid #d9dfe7; }
.material-body { width: 100%; min-height: 340px; font-family: monospace; padding: 14px; }
.material-preview { margin-top: 24px; padding: 24px; border: 1px solid #d9dfe7; }
.wiki-resource-figure { margin: 0; max-width: 100%; break-inside: avoid; }
.wiki-resource-figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.wiki-resource-figure figcaption { text-align: center; font-size: 0.9em; padding: 6px 0; overflow-wrap: anywhere; }
.material-content { overflow-wrap: anywhere; }
.material-content table { width: 100%; table-layout: fixed; }
.material-content td { vertical-align: top; }
.material-content .wiki-resource-figure img { max-height: 105mm; object-fit: contain; }
.material-content h1, .material-content h2, .material-content h3 { break-after: avoid; }
.material-content tr, .material-content figure { break-inside: avoid; }
.material-print-shell { padding: 24px; background: #edf0f4; min-height: 100vh; }
.material-print-toolbar { max-width: 186mm; margin: 0 auto 20px; display: flex; gap: 12px; flex-wrap: wrap; }
.material-print-content { width: 186mm; box-sizing: border-box; min-height: 273mm; padding: 12mm; margin: auto; background: white; color: #111; }
.material-print-content header { border-bottom: 1px solid #888; margin-bottom: 8mm; }
@media (max-width: 760px) { .material-print-content { width: 100%; padding: 16px; } .material-preview { padding: 12px; } }
@media print {
    body:has(.material-print-shell) { background: white !important; }
    .material-print-toolbar { display: none !important; }
    .material-print-shell { padding: 0; background: white; min-height: 0; }
    .material-print-content { page: statement-material; width: auto; min-height: 0; padding: 0; margin: 0; box-shadow: none; font-size: 10pt; }
    .material-content .rich-text { overflow: visible; }
    .material-content .wiki-resource-figure img { max-height: 105mm; }
    .material-content a { color: inherit; }
    @page statement-material { size: A4; margin: 12mm; }
}
