.tv-tool-app{color:#172033}.tv-tool-loading{padding:28px;text-align:center;color:#667085}
.tv-tool-panel{display:grid;gap:16px}.tv-tool-row{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.tv-tool-field{width:100%;border:1px solid #dbe2ee;border-radius:10px;padding:11px 12px;background:#fff;color:#172033}
.tv-tool-label{display:block;font-weight:650;margin-bottom:7px}.tv-tool-button{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:10px;background:#2457e6;color:#fff;padding:11px 17px;font-weight:650;cursor:pointer;text-decoration:none}
.tv-tool-button:hover{background:#1744c5;color:#fff}.tv-tool-button.secondary{background:#edf2ff;color:#2457e6}
.tv-tool-result{border:1px solid #dbe5f3;background:#f7f9fc;padding:14px;border-radius:12px;overflow-wrap:anywhere}
.tv-tool-note{font-size:.88rem;color:#667085}.tv-tool-drop{border:2px dashed #cbd5e1;border-radius:14px;padding:28px;text-align:center;background:#fafcff}
.tv-tool-app textarea{min-height:130px;resize:vertical}.tv-tool-app input[type=file]{max-width:100%}.tv-tool-preview{max-width:100%;height:auto;border-radius:10px}
.tv-tool-error{color:#b42318;background:#fff1f0;padding:10px 12px;border-radius:8px}.tv-tool-success{color:#067647;background:#ecfdf3;padding:10px 12px;border-radius:8px}

/* Image previews: source files, live crop area and processed outputs */
.tv-image-preview,.tv-output-preview{border:1px solid #dbe5f3;background:#f8faff;border-radius:14px;padding:14px;min-width:0}
.tv-image-preview>strong,.tv-output-preview>strong{display:block;margin-bottom:10px}
.tv-preview-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(125px,1fr));gap:12px;margin-top:10px}
.tv-preview-item{min-width:0;border:1px solid #e2e8f0;background:#fff;border-radius:10px;padding:8px;overflow:hidden}
.tv-preview-item img{display:block;width:100%;height:110px;object-fit:contain;background:#f1f5f9;border-radius:7px}
.tv-preview-item small{display:block;margin-top:7px;color:#475467;overflow-wrap:anywhere;font-size:12px}
.tv-output-preview{display:grid;gap:8px;margin-bottom:12px}
.tv-output-preview img{display:block;max-width:100%;max-height:380px;width:auto;height:auto;object-fit:contain;background:#eef2f7}
.tv-output-preview small{color:#667085}
.tv-batch-output{margin-top:14px}
#tvCropPreview img{max-width:100%;object-fit:contain}
@media(max-width:600px){.tv-preview-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.tv-preview-item img{height:90px}}

/* Interactive crop selection: move the frame or drag its lower-right handle. */
.tv-crop-stage{position:relative;display:inline-block;max-width:100%;width:max-content;line-height:0;overflow:hidden;border-radius:12px;background:#111827;touch-action:pan-y;user-select:none}
.tv-crop-stage>img{display:block;max-width:100%;max-height:520px;width:auto;height:auto;object-fit:contain;pointer-events:none}
.tv-crop-selection{position:absolute;left:0;top:0;width:60%;height:60%;border:2px solid #fff;box-shadow:0 0 0 9999px rgba(0,0,0,.48);cursor:move;box-sizing:border-box;touch-action:none}
.tv-crop-selection:after{content:"";position:absolute;inset:33.333%;border:1px solid rgba(255,255,255,.65);pointer-events:none}
.tv-crop-handle{position:absolute;right:-2px;bottom:-2px;width:22px;height:22px;border:2px solid #fff;border-radius:5px;background:#2457e6;cursor:nwse-resize;touch-action:none;z-index:2}
.tv-crop-handle:after{content:"";position:absolute;inset:5px;border-right:2px solid #fff;border-bottom:2px solid #fff}
@media(max-width:600px){.tv-crop-stage>img{max-height:420px}.tv-crop-handle{width:28px;height:28px}}

.tv-tool-result strong{display:block;font-size:1.2rem;margin-top:5px}.tv-tool-result{min-width:140px}.tv-preview-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:12px}.tv-preview-item{min-width:0}.tv-preview-item img{width:100%;height:110px;object-fit:contain;background:#f6f7fb;border:1px solid #e5e7ef;border-radius:10px}.tv-preview-item small{display:block;overflow-wrap:anywhere;margin-top:6px}.tv-tool-note{font-size:.82rem;color:#667085}
