/* Image Requirement Fixer. Only this tool's own pieces; everything else is the shared tool frame.
   Colours come from the site's variables only (tests/catalogue.test.mjs checks there are no hex values here). */

/* Choosing the image: the file input is the real control (focusable, read by screen readers); the button-like label
   in front of it is what's tapped. A dropped file works too. */
.ir-pick { position: relative; margin-bottom: 18px; }
.ir-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.ir-choose { cursor: pointer; }
.ir-pick:focus-within .ir-choose { outline: 2px solid var(--graphite); outline-offset: 2px; }
.ir-pick.is-over .ir-choose { box-shadow: inset 0 0 0 2px var(--graphite); }
.ir-orig { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-card); background: var(--mist); }
.ir-orig__name { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.ir-orig__facts { margin: 2px 0 0; font-size: 14px; color: var(--slate); font-variant-numeric: tabular-nums; }
.ir-rules-h { margin-top: 6px; }

.ir-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ir-px { font-size: 18px; font-variant-numeric: tabular-nums; }
.ir-dims .field { margin-bottom: 8px; }
.ir-dims .field__hint { margin: 0 0 14px; }
.ir-nowebp { margin: -8px 0 16px; }
.chip.is-off { opacity: .45; }
.chip.is-off span { cursor: not-allowed; }
.ir-limit { display: flex; align-items: center; gap: 10px; }
.ir-limit .input { flex: 1 1 auto; min-width: 0; }
.ir-limit .chips { flex: 0 0 auto; margin: 0; flex-wrap: nowrap; }
.ir-colour { display: flex; align-items: center; gap: 12px; }
.ir-colour label { margin: 0; }
.ir-colour__in { width: 52px; height: 44px; padding: 2px; border: 1px solid var(--silver); border-radius: var(--r-ctl); background: var(--white); cursor: pointer; }
#ir-go { margin-top: 4px; }

/* The sheet: the original (with the crop on it) beside what the new file will be, then the numbers and the checks. */
.ir-empty { margin: 0; padding: 30px 0 18px; font-size: 15px; color: var(--steel); }
.ir-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; align-items: start; }
.ir-fig { margin: 0; min-width: 0; }
.ir-fig figcaption { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--slate); }
.ir-frame { position: relative; width: fit-content; max-width: 100%; overflow: hidden; border-radius: var(--r-ctl); box-shadow: 0 0 0 1px var(--silver); line-height: 0; }
/* see-through parts show as a light check */
.ir-frame--new { background-color: var(--white); background-image: conic-gradient(var(--mist) 25%, transparent 0 50%, var(--mist) 0 75%, transparent 0); background-size: 16px 16px; }
.ir-img { display: block; max-width: 100%; max-height: 300px; width: auto; height: auto; }
.ir-crop { position: absolute; box-shadow: 0 0 0 9999px rgba(255, 255, 255, .62); outline: 2px solid var(--graphite); outline-offset: -1px; pointer-events: none; }
.ir-cropnote, .ir-newname { margin: 6px 0 0; font-size: 13.5px; color: var(--slate); overflow-wrap: anywhere; }

.ir-result { margin-top: 20px; }
.ir-verdict { margin: 0 0 12px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.ir-verdict:empty { display: none; }
.ir-verdict.is-bad::before { content: "✕ "; }
.ir-verdict:not(.is-bad)::before { content: "✓ "; }
.ir-table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.ir-table th, .ir-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--silver); text-align: left; vertical-align: top; }
.ir-table thead th { font-size: 13px; font-weight: 600; color: var(--slate); }
.ir-table tbody th { font-weight: 500; color: var(--slate); width: 34%; }
.ir-table td { overflow-wrap: anywhere; }

.ir-sec { margin-top: 18px; }
.ir-sec__h { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.ir-checks, .ir-list { margin: 0; padding: 0; list-style: none; }
.ir-check { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 9px 12px; border-radius: var(--r-ctl); background: var(--mist); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.ir-check + .ir-check { margin-top: 6px; }
.ir-check.is-bad { background: var(--white); box-shadow: inset 0 0 0 2px var(--graphite); }
.ir-check__mark { font-weight: 600; white-space: nowrap; }
.ir-check__want { color: var(--slate); }
.ir-list li { position: relative; padding: 3px 0 3px 16px; font-size: 14.5px; }
.ir-list li::before { content: ""; position: absolute; left: 2px; top: 12px; width: 5px; height: 5px; border-radius: 50%; background: var(--graphite); }
@media (max-width: 420px) { .ir-check { grid-template-columns: 1fr; gap: 2px; } }
