/* Model library — reuses .badge / .projects-grid / .project-card from projects.css. */
.badge.mstatus-want_to_print { background: #eff6ff; color: #1e40af; }
.badge.mstatus-printed       { background: #ecfdf5; color: #065f46; }
.badge.mstatus-failed        { background: #fef2f2; color: #991b1b; }

.models-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0 18px; }
.models-toolbar .filter.active { font-weight: 600; text-decoration: underline; }
.models-toolbar input[type="search"] { flex: 1; min-width: 160px; }

/* Detail page: main column (image → instructions) + side column (meta → files → print log). */
.model-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 28px; align-items: start; }
@media (max-width: 800px) { .model-layout { grid-template-columns: 1fr; } }

.model-hero { margin-bottom: 14px; }
.model-hero-img { display: block; width: 100%; max-height: 60vh; object-fit: contain;
                  background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; }
.model-hero-thumb { display: flex; align-items: center; justify-content: center; width: 100%;
                    aspect-ratio: 4/3; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; }
.model-hero-thumb img { max-width: 100%; max-height: 100%; }
.model-hero-empty { display: flex; align-items: center; justify-content: center; width: 100%;
                    aspect-ratio: 4/3; font-size: 48px; background: #f8fafc; border-radius: 10px; }

.image-gallery { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.image-gallery img { width: 84px; height: 66px; object-fit: cover; border-radius: 6px; border: 1px solid #e5e7eb; }

.model-instructions, .model-notes { margin-top: 20px; }
.model-instructions h2, .model-notes h2, .model-files h2 { font-size: 15px; margin: 0 0 10px; }
.model-main .preview-pdf { width: 100%; height: 640px; border: 1px solid #e5e7eb; border-radius: 8px; }

/* Files as a scrollable folder tree. */
.model-files { margin-bottom: 22px; }
.file-tree-box { border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 6px; max-height: 420px;
                 overflow: auto; background: #fff; font-size: 13px; }
.file-tree { list-style: none; margin: 0; padding: 0; }
.file-tree .file-tree { margin-left: 16px; padding-left: 6px; border-left: 1px solid #f1f5f9; }
.file-tree li { padding: 1px 0; }
.tree-dir > details > summary { cursor: pointer; list-style: none; padding: 2px 4px; border-radius: 4px; }
.tree-dir > details > summary::-webkit-details-marker { display: none; }
.tree-dir > details > summary:hover { background: #f8fafc; }
.tree-folder::before { content: "📁"; margin-right: 6px; }
.tree-folder { font-weight: 600; color: #334155; }
.tree-file .tree-fname { display: block; padding: 2px 4px 2px 22px; border-radius: 4px;
                         white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-file .tree-fname::before { content: "🧊"; margin-left: -18px; margin-right: 4px; }
.tree-file .tree-fname:hover { background: #f8fafc; }

.model-print-settings { margin-bottom: 22px; }
.ps-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; margin: 0;
           border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 12px; }
.ps-grid dt { color: #64748b; white-space: nowrap; }
.ps-grid dd { margin: 0; }

.print-log .print-run { padding: 8px 0; border-bottom: 1px solid #eee; font-size: 14px; }
.print-form { display: grid; gap: 8px; max-width: 480px; }
.print-form .row { display: flex; gap: 10px; }
