/* Defects tab and the photo mark-up window (js/defects.js) */
.df-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.df-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.df-title { background: none; border: 0; padding: 0; font: 650 15px/1.3 var(--font-head); color: var(--accent); cursor: pointer; text-align: left; margin-right: 4px; }
.df-title:hover { text-decoration: underline; }
.df-top select.df-st { width: auto; flex: none; margin-left: auto; padding: 4px 28px 4px 8px; font-size: 13px; }
.df-pill { font: 600 10px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; padding: 5px 9px; border-radius: 9999px; background: var(--surface-2); color: var(--ink-2); }
.df-pill.st-open, .df-pill.late, .df-pill.pr-high { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad-ink); }
.df-pill.st-in-progress, .df-pill.st-ready-for-inspection, .df-pill.pr-medium { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn-ink, var(--ink)); }
.df-pill.st-closed { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good-ink, var(--good)); }
.df-closed { opacity: .78; }
.df-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 18px; }
@media (max-width: 760px) { .df-body { grid-template-columns: 1fr; } }
.df-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; font-weight: 560; }
.df-grid small, .df-desc small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 400; }
.df-res { display: block; font-size: 12px; font-weight: 400; color: var(--good-ink, var(--good)); }
.df-desc { margin-top: 12px; white-space: pre-wrap; }
.df-ph { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; align-content: start; }
.df-ph > button { position: relative; padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 4 / 3; background: var(--surface-2); }
.df-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.df-ph button span { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.df-ph .df-addph { display: grid; place-items: center; align-content: center; gap: 4px; color: var(--ink-3); border: 1px dashed var(--line-2); background: none; font-size: 12px; }
/* the defect window's photos */
.df-fph { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.df-fph .tile { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.df-fph .tile > button { position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer; background: var(--surface-2); }
.df-fph .tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.df-fph .tile .row { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 4px 6px; }
.df-fph .tile .note { padding: 0 8px 8px; font-size: 12px; color: var(--ink-2); }
.df-fph .busy { display: grid; place-items: center; min-height: 110px; color: var(--ink-3); font-size: 13px; }
.df-tag { position: absolute; left: 6px; top: 6px; font: 600 10px/1 var(--font-body); padding: 4px 7px; border-radius: 9999px; background: #1f6feb; color: #fff; }
.df-arow { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.df-arow .input { flex: 1; }
.df-chk { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; }
/* the mark-up window (above the defect window) */
.mk-back { position: fixed; inset: 0; z-index: 120; background: rgba(10, 12, 10, .82); display: flex; align-items: center; justify-content: center; padding: 12px; }
.mk { background: var(--surface); border-radius: 14px; width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-pop); }
.mk-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.mk-grp { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.mk-bar .btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.mk-sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); padding: 0; cursor: pointer; }
.mk-sw[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.mk-stage { position: relative; flex: 1; min-height: 160px; display: flex; align-items: center; justify-content: center; background: #151714; padding: 8px; overflow: hidden; }
.mk-stage canvas { max-width: 100%; max-height: calc(100vh - 250px); touch-action: none; cursor: crosshair; display: block; }
.mk-msg { position: absolute; color: #ddd; font-size: 14px; padding: 20px; text-align: center; }
.mk-msg:empty { display: none; }
.mk-foot { display: flex; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: flex-end; flex-wrap: wrap; }
.mk-foot textarea { flex: 1; min-width: 220px; }
.mk-btns { display: flex; gap: 8px; }
