/* The image converters and makers: what their pages share beyond tool.css.
   Every size, corner and colour is a token from theme.css. */

.status-line.ik-bad { color: var(--danger); border-left-color: var(--danger); }
.dropzone.is-over { border-color: var(--accent-strong); background: var(--paper-raised); }
.dropzone:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.dropzone strong { display: block; font-size: var(--text-md); margin-bottom: 4px; color: var(--ink); }
.dropzone span { font-size: var(--text-xs); color: var(--ink-soft); }

/* A picture on show. A see-through part reads as a chequerboard, the way
   every image program shows it, rather than as the page behind it. */
.ik-stage {
  display: flex; align-items: center; justify-content: center;
  min-height: 160px; padding: 12px; border: 1px solid var(--rule); border-radius: var(--radius-md);
  background: repeating-conic-gradient(var(--paper-inset) 0 25%, var(--paper-raised) 0 50%) 0 0 / 16px 16px;
  overflow: hidden;
}
.ik-stage canvas, .ik-stage img { display: block; max-width: 100%; max-height: 62vh; height: auto; width: auto; }
.ik-stage.is-plain { background: var(--paper-inset); }
.ik-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.ik-cap { font-size: var(--text-xs); color: var(--ink-soft); margin: 6px 0 0; overflow-wrap: anywhere; }

/* A row of controls that wraps on a phone. */
.ik-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.ik-row .field { margin-bottom: 0; }
.ik-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: var(--text-sm); color: var(--ink); cursor: pointer; }
.ik-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-strong); }
.ik-range { display: flex; align-items: center; gap: 10px; }
.ik-range input[type="range"] { flex: 1; min-width: 0; }
.ik-range output { font-family: var(--font-mono); font-size: var(--text-xs); min-width: 52px; text-align: right; color: var(--ink-soft); }

/* A strip of pictures: the frames of an animation, the images in a
   collage, the pages of a TIFF, the layers of a PSD. */
.ik-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin: 12px 0 0; }
.ik-thumb { border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper-raised); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ik-thumb.is-off { opacity: .45; }
.ik-thumb canvas, .ik-thumb img { width: 100%; height: 96px; object-fit: contain; border-radius: var(--radius-sm);
  background: repeating-conic-gradient(var(--paper-inset) 0 25%, var(--paper-raised) 0 50%) 0 0 / 12px 12px; }
.ik-thumb b { font-size: var(--text-xs); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ik-thumb span { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--ink-soft); }
.ik-acts { display: flex; flex-wrap: wrap; gap: 4px; }
.ik-acts button {
  min-width: 36px; min-height: 36px; padding: 4px 8px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm);
  background: var(--paper-inset); color: var(--ink); font: inherit; font-size: var(--text-xs); cursor: pointer;
}
.ik-acts button:hover { border-color: var(--accent-strong); }
.ik-acts button:disabled { opacity: .4; cursor: default; }

@media (max-width: 700px) {
  .ik-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (pointer: coarse) {
  .ik-acts button { min-width: 44px; min-height: 44px; }
}
.ik-fig { margin: 0; min-width: 0; }
.ik-gap { margin-top: 14px; }
.ik-bad-text { color: var(--danger); }
.ik-thumb.is-on { border-color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent-strong); }
/* A layer inside a group sits in from its group. */
.ik-d1 { padding-left: 18px; }
.ik-d2 { padding-left: 36px; }
.ik-d3 { padding-left: 54px; }
.ik-d4 { padding-left: 72px; }
.ik-item { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.ik-item img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--rule); flex-shrink: 0; }
.ik-item > div { min-width: 0; }
.ik-num { width: 100%; min-height: 36px; padding: 4px 8px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--paper-inset); color: var(--ink); font: inherit; font-size: var(--text-xs); }
@media (pointer: coarse) { .ik-num { min-height: 44px; } }
.ik-grid { display: grid; gap: 4px; margin: 12px 0 0; }
.ik-grid img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }
