/* Auto jin Tools - shared styles for bulk (multi-file) tools. Loaded after tool-site.css. */
.batch-dropzone { position: relative; display: grid; min-height: 190px; place-items: center; padding: 24px; border: 1.5px dashed #c8c9cc; border-radius: 8px; color: var(--tool-muted); background: #f7f8fa; text-align: center; cursor: pointer; }
.batch-dropzone:hover, .batch-dropzone.is-dragging, .batch-dropzone:focus-visible { border-color: var(--tool-brand); background: var(--tool-brand-tint); }
.batch-dropzone strong { display: block; color: var(--tool-ink); font-size: 1rem; }
.batch-dropzone span { display: block; margin-top: 4px; font-size: .82rem; }
.batch-dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.batch-dropzone .upload-icon { margin-bottom: 10px; }

.batch-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 14px; }
.batch-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.batch-count { color: var(--tool-ink); font-size: .86rem; font-weight: 700; }
.batch-count small { margin-left: 6px; color: var(--tool-muted); font-weight: 400; }

.batch-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.batch-item { position: relative; display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden; border: 1px solid var(--tool-border); border-radius: 8px; background: #fff; }
.batch-item.is-error { border-color: #f5b8b3; }
.batch-item.is-done { border-color: #b7e3d2; }
.batch-thumb { position: relative; display: grid; aspect-ratio: 4 / 3; place-items: center; overflow: hidden; background: #f2f3f6; }
.batch-thumb img, .batch-thumb canvas { width: 100%; height: 100%; object-fit: contain; }
.batch-thumb .batch-file-icon { color: var(--tool-muted); font-size: 1.6rem; font-weight: 800; }
.batch-index { position: absolute; top: 6px; left: 6px; min-width: 24px; padding: 2px 7px; border-radius: 999px; color: #fff; background: rgba(33, 33, 36, .78); font-size: .72rem; font-weight: 700; text-align: center; }
.batch-remove { position: absolute; top: 6px; right: 6px; display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #4d5159; background: rgba(255, 255, 255, .94); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); font-size: 1rem; line-height: 1; cursor: pointer; }
.batch-remove:hover, .batch-remove:focus-visible { color: var(--tool-danger); }
.batch-meta { display: grid; gap: 2px; min-width: 0; padding: 8px 10px 10px; font-size: .74rem; line-height: 1.4; }
.batch-name { overflow: hidden; color: var(--tool-ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.batch-detail { overflow: hidden; color: var(--tool-muted); text-overflow: ellipsis; white-space: nowrap; }
.batch-result { color: var(--tool-success); font-weight: 700; overflow-wrap: anywhere; }
.batch-item.is-error .batch-result { color: var(--tool-danger); }
.batch-item-actions { display: flex; gap: 6px; margin-top: 6px; }
.batch-item-actions button, .batch-item-actions a { min-height: 30px; padding: 0 10px; border: 1px solid var(--tool-border); border-radius: 6px; color: var(--tool-ink); background: #fff; font-size: .72rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; }
.batch-item-actions button:hover, .batch-item-actions a:hover { border-color: #9da1a8; }

.batch-rows { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.batch-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--tool-border); border-radius: 8px; background: #fff; }
.batch-row .batch-index { position: static; }
.batch-row .batch-remove { position: static; box-shadow: none; background: #f2f3f6; }
.batch-row-actions { display: flex; gap: 6px; align-items: center; }
.batch-row-actions button { display: grid; width: 30px; height: 30px; place-items: center; padding: 0; border: 1px solid var(--tool-border); border-radius: 6px; color: var(--tool-ink); background: #fff; cursor: pointer; }
.batch-row-actions button:disabled { opacity: .4; cursor: not-allowed; }

.batch-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 16px; }
.batch-options .lab-field input[type="range"] { width: 100%; accent-color: var(--tool-brand); }
.batch-options .lab-field output { color: var(--tool-brand-dark); font-weight: 700; }
.batch-options .check-field { min-height: 48px; }
.batch-segment { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--tool-border); border-radius: 8px; background: #f7f8fa; }
.batch-segment label { position: relative; }
.batch-segment input { position: absolute; opacity: 0; pointer-events: none; }
.batch-segment span { display: inline-flex; min-height: 36px; align-items: center; padding: 0 12px; border-radius: 6px; color: #4d5159; font-size: .82rem; font-weight: 700; cursor: pointer; }
.batch-segment input:checked + span { color: #fff; background: var(--tool-brand); }
.batch-segment input:focus-visible + span { outline: 3px solid rgba(255, 111, 15, .28); outline-offset: 1px; }

.batch-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.batch-progress { margin-top: 14px; }
.batch-progress-bar { height: 8px; overflow: hidden; border-radius: 999px; background: #eaebee; }
.batch-progress-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--tool-brand); transition: width 160ms ease; }
.batch-progress-text { margin: 6px 0 0; color: var(--tool-muted); font-size: .8rem; }
.batch-summary { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--tool-border); border-radius: 8px; background: #f7f8fa; font-size: .84rem; }
.batch-summary strong { color: var(--tool-ink); }
.batch-empty { margin: 14px 0 0; padding: 18px; border: 1px dashed var(--tool-border); border-radius: 8px; color: var(--tool-muted); font-size: .84rem; text-align: center; }
.batch-hint { margin: 8px 0 0; color: var(--tool-muted); font-size: .78rem; }
.sr-only-batch { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

html[data-theme="dark"] .batch-dropzone { border-color: #46494f; background: #202226; }
html[data-theme="dark"] .batch-dropzone:hover, html[data-theme="dark"] .batch-dropzone.is-dragging { background: #2c1b12; }
html[data-theme="dark"] .batch-item, html[data-theme="dark"] .batch-row, html[data-theme="dark"] .batch-summary { border-color: #303236; background: #1a1c20; }
html[data-theme="dark"] .batch-thumb { background: #25272b; }
html[data-theme="dark"] .batch-remove { color: #e5e7eb; background: rgba(37, 39, 43, .94); }
html[data-theme="dark"] .batch-row .batch-remove, html[data-theme="dark"] .batch-row-actions button, html[data-theme="dark"] .batch-item-actions button, html[data-theme="dark"] .batch-item-actions a { color: #f7f8fa; border-color: #303236; background: #25272b; }
html[data-theme="dark"] .batch-segment { border-color: #303236; background: #202226; }
html[data-theme="dark"] .batch-segment span { color: #c8c9cc; }
html[data-theme="dark"] .batch-progress-bar { background: #303236; }
html[data-theme="dark"] .batch-empty { border-color: #303236; }
html[data-theme="dark"] .batch-item.is-error { border-color: #7a2a24; }
html[data-theme="dark"] .batch-item.is-done { border-color: #1f5a45; }

@media (max-width: 680px) {
    .batch-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .batch-options { grid-template-columns: 1fr; }
    .batch-toolbar { align-items: stretch; }
    .batch-actions .button { flex: 1 1 100%; }
}

