/* Images -> PDF page. Drop zone, then a grid of image cards, page options, Create / progress / result. */
.ip-wrap { max-width: 960px; margin: 0 auto; padding: 96px 16px 48px; color: var(--text-primary); box-sizing: border-box;
  --ip-warn: var(--color-warning, #f59e0b); --ip-err: var(--color-danger-hover, #f87171); }
:root[data-theme="light"] .ip-wrap { --ip-warn: #b45309; --ip-err: #b91c1c; }
.ip-wrap *, .ip-wrap *::before, .ip-wrap *::after { box-sizing: border-box; }
.ip-wrap [hidden] { display: none !important; }
.ip-intro h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 8px; }
.ip-intro p { color: var(--text-secondary); margin: 0 0 8px; max-width: 70ch; }
.ip-drop { display: grid; place-items: center; gap: 6px; padding: 28px 16px; margin: 16px 0; border: 2px dashed var(--border-color); border-radius: 12px; cursor: pointer; text-align: center; background: var(--bg-secondary); position: relative; min-width: 0; }
.ip-drop.over, .ip-drop:focus-within { border-color: var(--color-primary); }
.ip-drop.ip-off { opacity: 0.5; cursor: not-allowed; }
.ip-drop small { color: var(--text-secondary); }
.ip-sr { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ip-error { color: var(--ip-err); min-height: 1em; margin: 6px 0; overflow-wrap: anywhere; }
.ip-error:empty, .ip-adding:empty { min-height: 0; margin: 0; }
.ip-adding, .ip-status { color: var(--text-secondary); margin: 6px 0; overflow-wrap: anywhere; }
.ip-skipped { border: 1px solid var(--border-color); border-left: 4px solid var(--ip-warn); border-radius: 10px; padding: 10px 14px; margin: 8px 0 16px; background: var(--bg-secondary); min-width: 0; }
.ip-skipped-head { margin: 0 0 4px; font-weight: 600; }
.ip-skipped ul { margin: 0; padding-left: 1.2em; }
.ip-skipped li { overflow-wrap: anywhere; color: var(--text-secondary); }
.ip-skipped li b { color: var(--text-primary); font-weight: 600; }
.ip-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 4px; }
.ip-count { font-weight: 600; }
.ip-hint { color: var(--text-secondary); font-size: 0.9rem; margin: 0 0 12px; }
.ip-grid { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.ip-card { position: relative; display: grid; gap: 6px; padding: 8px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-secondary); min-width: 0; user-select: none; -webkit-user-select: none; cursor: grab; }
.ip-card:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.ip-card.ip-dragging { z-index: 2; opacity: 0.85; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); cursor: grabbing; }
.ip-card.ip-drop-before { box-shadow: -4px 0 0 0 var(--color-primary); }
.ip-card.ip-drop-after { box-shadow: 4px 0 0 0 var(--color-primary); }
.ip-thumb { aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: 6px;
  background: repeating-conic-gradient(var(--bg-primary) 0 25%, var(--bg-tertiary, var(--bg-secondary)) 0 50%) 50% / 16px 16px; }
.ip-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform 0.15s; pointer-events: none; }
.ip-num { position: absolute; top: 12px; left: 12px; min-width: 24px; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 0.8rem; font-weight: 700; text-align: center; }
.ip-name { margin: 0; font-size: 0.85rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ip-tools { display: flex; gap: 6px; justify-content: space-between; }
.ip-tools button, .ip-grip { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--border-color); border-radius: 8px; background: transparent; color: var(--text-primary); cursor: pointer; padding: 0; font: inherit; }
.ip-tools button:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.ip-tools button:hover { border-color: var(--text-secondary); }
.ip-tools svg { width: 20px; height: 20px; }
.ip-grip { touch-action: none; cursor: grab; color: var(--text-secondary); border-style: dashed; }
.ip-options { border: 0; margin: 0 0 16px; padding: 0; display: grid; gap: 14px; min-width: 0; }
.ip-set { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.ip-set legend { font-weight: 600; font-size: 0.9rem; color: var(--text-secondary); padding: 0; margin-bottom: 6px; }
.ip-choice { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; min-height: 44px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-secondary); cursor: pointer; }
.ip-choice:has(input:checked) { border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary); }
.ip-choice:has(input:focus-visible), .ip-check:has(input:focus-visible) { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.ip-choice input, .ip-check input { margin: 0; width: 18px; height: 18px; flex: none; accent-color: var(--color-primary); }
.ip-check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.ip-options:disabled { opacity: 0.6; }
.ip-actions { margin: 0 0 12px; }
.ip-btn { border: 1px solid var(--border-color); background: transparent; color: var(--text-primary); border-radius: 10px; padding: 10px 18px; min-height: 44px; cursor: pointer; font: inherit; }
.ip-btn--small { padding: 6px 14px; min-height: 40px; }
.ip-btn--primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; font-weight: 600; }
.ip-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ip-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.ip-progress { display: grid; gap: 8px; justify-items: start; margin: 0 0 12px; }
.ip-progress progress { width: 100%; height: 12px; accent-color: var(--color-primary); }
.ip-progress p { margin: 0; color: var(--text-secondary); }
.ip-result { display: grid; gap: 6px; justify-items: start; padding: 16px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-secondary); margin: 0 0 12px; min-width: 0; }
.ip-result-line { margin: 0; font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
.ip-result .ip-btn { margin-top: 8px; }
.img-foot { text-align: center; padding: 24px 16px; font-size: 0.875rem; }
.img-foot a { color: var(--text-secondary); }
.ip-lic { margin: 8px auto 0; max-width: 60ch; color: var(--text-secondary); font-size: 0.8rem; overflow-wrap: anywhere; }
@media (max-width: 420px) {
  .ip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ip-tools button, .ip-grip { width: 38px; height: 38px; }
}
