/* Toolszu PDF Browser Tools — extra styles on top of /tools/common/pdf-convert/convert.css */
.tzb { max-width: 900px; }
.tzb.is-over .tzc-card { outline: 3px dashed var(--tzc-blue); outline-offset: 4px; }
.tzb-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.tzb-idle-error { margin: .9rem auto 0; max-width: 520px; color: #b91c1c; font-size: .88rem; }

/* list header */
.tzb-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .8rem; }
.tzb-count { font-weight: 700; color: var(--tzc-ink); font-size: .95rem; }
.tzb-head-actions { display: flex; gap: .25rem; flex-wrap: wrap; }
.tzb-head-actions .tzc-link { font-size: .85rem; }

/* file cards */
.tzb-list { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.tzb-item { position: relative; background: #f8fafc; border: 1px solid var(--tzc-line); border-radius: 14px; padding: .55rem; display: flex; flex-direction: column; gap: .45rem; transition: border-color .15s, box-shadow .15s, opacity .15s; }
.tzb-item[draggable="true"] { cursor: grab; }
.tzb-item.is-drag { opacity: .45; }
.tzb-item.is-target { border-color: var(--tzc-blue); box-shadow: 0 0 0 3px rgba(0, 102, 204, .2); }
.tzb-thumb { position: relative; aspect-ratio: 3 / 4; background: #fff; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; border: 1px solid #edf2f7; }
.tzb-thumb img { max-width: 92%; max-height: 92%; object-fit: contain; transition: transform .2s; box-shadow: 0 1px 4px rgba(15, 23, 42, .15); }
.tzb-ext { position: absolute; left: 6px; bottom: 6px; background: rgba(15, 23, 42, .72); color: #fff; font: 700 .65rem/1 'Inter', sans-serif; padding: .25rem .4rem; border-radius: 6px; letter-spacing: .03em; }
.tzb-item.is-pdf.no-thumb .tzb-thumb::before { content: "\f1c1"; color: #ef4444; }
.tzb-item.is-doc.no-thumb .tzb-thumb::before { content: "\f15c"; color: #3b82f6; }
.tzb-item.no-thumb .tzb-thumb::before { content: "\f1c5"; font-family: "Font Awesome 6 Free", "Font Awesome 5 Free"; font-weight: 900; font-size: 2.2rem; color: #94a3b8; }
.tzb-num { position: absolute; right: 6px; top: 6px; min-width: 22px; height: 22px; padding: 0 .35rem; border-radius: 99px; background: var(--tzc-blue); color: #fff; font: 700 .72rem/22px 'Inter', sans-serif; text-align: center; }
.tzb-meta { min-width: 0; padding: 0 .1rem; }
.tzb-name { font-weight: 600; font-size: .8rem; color: var(--tzc-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tzb-size { font-size: .72rem; color: var(--tzc-muted); }
.tzb-tools { display: flex; justify-content: space-between; gap: .25rem; }
.tzb-tools button { flex: 1; height: 30px; border: 1px solid var(--tzc-line); background: #fff; border-radius: 8px; color: #475569; cursor: pointer; font-size: .78rem; }
.tzb-tools button:hover { background: #eff6ff; color: var(--tzc-blue); border-color: #bfdbfe; }
.tzb-tools button[disabled] { opacity: .35; pointer-events: none; }
.tzb-tools .tzb-del:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

.tzb-add { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .9rem; }
.tzb-add:empty { display: none; }
.tzb-add .tzc-btn { padding: .7rem 1.2rem; font-size: .92rem; }
.tzb-hint { text-align: center; font-size: .8rem; color: var(--tzc-muted); margin: .7rem 0 0; }
.tzb-options { border-top: 1px solid var(--tzc-line); padding-top: 1rem; }
.tzb-options .tzc-choices { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tzb-options .tzc-choice span { padding: .65rem .8rem; }
.tzb-opt-group + .tzb-opt-group { margin-top: .9rem; }

@media (max-width: 560px) {
  .tzb-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .tzb-tools button { height: 34px; }
}

/* single-file mode (PDF tools): one bigger card */
.tzb[data-multiple="0"] .tzb-list { grid-template-columns: minmax(0, 220px); justify-content: center; }

/* results: single downloads */
.tzb-results { margin: 1.4rem auto 0; max-width: 820px; text-align: left; }
.tzb-results-title { font-weight: 700; font-size: .9rem; color: var(--tzc-ink); margin: 0 0 .6rem; text-align: center; }
.tzb-results-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); max-height: 420px; overflow-y: auto; padding: .25rem; }
.tzb-part { display: flex; flex-direction: column; gap: .35rem; align-items: center; text-decoration: none; background: #f8fafc; border: 1px solid var(--tzc-line); border-radius: 12px; padding: .45rem; color: #334155; transition: border-color .15s, background .15s; }
.tzb-part:hover { border-color: #93c5fd; background: #eff6ff; }
.tzb-part img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #fff; border-radius: 6px; }
.tzb-part i { font-size: 2rem; color: #94a3b8; padding: 1.4rem 0; }
.tzb-part span { font-size: .7rem; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.tzb-pages-hint { font-size: .78rem; color: var(--tzc-muted); margin-top: .25rem; }
.tzc-field > span.tzb-pages-hint { font-weight: 400; font-size: .78rem; color: var(--tzc-muted); margin: .3rem 0 0; }

/* page mode (organize / rotate) */
.tzb-bulk { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin: 0 0 .9rem; }
.tzb-bulk .tzc-btn { padding: .55rem .9rem; font-size: .85rem; }
.tzb-item.is-page .tzb-thumb { aspect-ratio: 1 / 1.25; }
.tzb-item.is-rotated .tzb-thumb { box-shadow: inset 0 0 0 2px #93c5fd; }

/* crop editor */
.tzb-crop { margin-bottom: .5rem; }
.tzb-crop-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem; margin-bottom: .8rem; }
.tzb-crop-bar label { display: flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .88rem; color: #334155; }
.tzb-crop-bar select { width: auto; padding: .45rem .6rem; }
.tzb-crop-bar .tzc-btn { padding: .55rem .9rem; font-size: .85rem; }
.tzb-crop-stage { position: relative; margin: 0 auto; width: fit-content; max-width: 100%; touch-action: none; user-select: none; overflow: hidden; border-radius: 6px; box-shadow: 0 2px 10px rgba(15, 23, 42, .15); }
.tzb-crop-stage canvas { display: block; max-width: 100%; max-height: 760px; width: auto; height: auto; background: #fff; }
.tzb-crop-box { position: absolute; border: 2px solid #0066cc; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .45); cursor: move; }
.tzb-crop-box i { position: absolute; width: 18px; height: 18px; background: #fff; border: 2px solid #0066cc; border-radius: 50%; margin: -9px 0 0 -9px; touch-action: none; }
.tzb-crop-box i[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; } .tzb-crop-box i[data-h="n"] { left: 50%; top: 0; cursor: ns-resize; }
.tzb-crop-box i[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; } .tzb-crop-box i[data-h="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.tzb-crop-box i[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; } .tzb-crop-box i[data-h="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.tzb-crop-box i[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; } .tzb-crop-box i[data-h="w"] { left: 0; top: 50%; cursor: ew-resize; }
@media (pointer: coarse) { .tzb-crop-box i { width: 26px; height: 26px; margin: -13px 0 0 -13px; } }
.tzb-crop-mm { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-top: .9rem; }
@media (max-width: 560px) { .tzb-crop-mm { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tzb[data-mount="1"] .tzb-list { display: none; }

/* text tools */
.tzb-idle-extra { margin-top: 1rem; }
.tzb-or { display: flex; align-items: center; gap: .75rem; color: var(--tzc-muted); font-size: .85rem; font-weight: 600; margin: .25rem 0 .75rem; }
.tzb-or::before, .tzb-or::after { content: ""; flex: 1; height: 1px; background: var(--tzc-line); }
.tzb-paste { width: 100%; min-height: 160px; resize: vertical; font: .95rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tzb-idle-extra .tzc-btn { margin-top: .6rem; }
.tzb-preview { margin: 1.3rem auto 0; max-width: 820px; text-align: left; }
.tzb-preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.tzb-preview-head .tzc-btn { padding: .5rem .9rem; font-size: .85rem; }
.tzb-preview textarea { font: .85rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }

/* fill form */
.tzb-form-count { font-weight: 700; color: var(--tzc-ink); margin: 0 0 .8rem; text-align: center; }
.tzb-form-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; padding: 1rem 0; border-top: 1px solid var(--tzc-line); }
@media (max-width: 760px) { .tzb-form-page { grid-template-columns: 1fr; } }
.tzb-form-prev { position: relative; border-radius: 6px; overflow: hidden; box-shadow: 0 2px 10px rgba(15, 23, 42, .15); position: sticky; top: .5rem; }
.tzb-form-prev canvas { display: block; width: 100%; height: auto; background: #fff; }
.tzb-form-box { position: absolute; border: 1.5px solid rgba(0, 102, 204, .7); background: rgba(0, 102, 204, .08); color: #0066cc; font: 700 10px/1 'Inter', sans-serif; padding: 1px 2px; cursor: pointer; overflow: hidden; }
.tzb-form-box.is-on { background: rgba(250, 204, 21, .35); border-color: #ca8a04; color: #854d0e; }
.tzb-form-n { display: inline-block; min-width: 20px; padding: 0 .3rem; border-radius: 99px; background: #e0efff; color: #0066cc; font-size: .72rem; text-align: center; margin-right: .2rem; }
.tzb-form-fields .tzc-field > span { font-weight: 600; }
.tzb-form-radios { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
