/* Attachments on quote and order line items: the editor, the read-only grid (screens, printouts, approval page). */

.la-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.la-grid:empty { display: none; }

.la-item {
    position: relative; width: 120px; break-inside: avoid; page-break-inside: avoid;
    border: 1px solid #d8e0e0; border-radius: 6px; background: #fff; overflow: hidden;
}
.la-thumb { display: flex; align-items: center; justify-content: center; height: 90px; text-decoration: none; }
.la-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.la-thumb .la-icon { display: none; font-size: 28px; color: #6b8080; }
.la-item.la-pdf .la-thumb .la-icon,
.la-item.la-broken .la-thumb .la-icon { display: block; }
.la-item.la-pdf .la-thumb .la-icon { color: #b3261e; }
.la-item.la-broken .la-thumb img { display: none; }
.la-name {
    display: block; padding: 3px 6px; font-size: 11px; line-height: 1.3; color: #3d5252;
    border-top: 1px solid #eef2f2; overflow-wrap: anywhere;
    max-height: 3.4em; overflow: hidden;
}

/* ── Editor ── */
.la-editor { margin-bottom: 12px; }
.la-remove {
    position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; padding: 0; line-height: 20px;
    border: 1px solid #d8e0e0; border-radius: 50%; background: #fff; color: #b3261e; cursor: pointer;
}
.la-pending .la-thumb { font-size: 12px; color: #6b8080; }
.la-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.la-actions .la-count { font-size: 12px; color: #6b8080; }
.la-link-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.la-link-form input { flex: 1 1 200px; }
.la-link-form[hidden], .la-photos[hidden], .la-actions [hidden] { display: none !important; }
.la-hint { font-size: 12px; color: #6b8080; margin-top: 4px; }

/* ── Site visit photo picker ── */
.la-photos { margin-top: 8px; padding: 10px; border: 1px dashed #c3d0d0; border-radius: 6px; max-height: 320px; overflow: auto; }
.la-photo {
    width: 120px; padding: 0; text-align: left; border: 2px solid #d8e0e0; border-radius: 6px; background: #fff;
    overflow: hidden; cursor: pointer;
}
.la-photo img { display: block; width: 100%; height: 80px; object-fit: cover; }
.la-photo span { display: block; padding: 2px 6px; font-size: 11px; line-height: 1.3; color: #3d5252; overflow-wrap: anywhere; }
.la-photo .la-internal { color: #8a5a00; font-weight: 600; }
.la-photo[aria-pressed="true"] { border-color: var(--clr-primary, #1f7a63); box-shadow: 0 0 0 2px var(--clr-primary, #1f7a63) inset; }
.la-photo:disabled { opacity: .45; cursor: not-allowed; }

@media print {
    .la-item { width: 130px; }
    .la-thumb { height: 100px; }
    .la-name { max-height: none; }
    .la-name[href]::after { content: none !important; }
}
