/* UnlockIR app pages (/convert/, /admin/). Everything is namespaced tb-. */
.tb-wrap { padding-top: 32px; padding-bottom: 24px; }
.tb-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 20px; margin: 0 0 20px; min-width: 0; }
.tb-card h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; }
.tb-card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.tb-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.tb-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 200px; min-width: 0; }
.tb-field label, .tb-label { font-size: 14px; color: var(--text-soft); }
.tb-field input, .tb-field select, .tb-input { min-height: 44px; padding: 0 12px; border-radius: 0; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: 16px var(--font); width: 100%; }
.tb-field .hint { font-size: 12px; color: var(--muted); }
.tb-check { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text-soft); }
.tb-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.tb-drop { border: 2px dashed var(--border-strong); border-radius: 0; padding: 28px 16px; text-align: center; display: grid; gap: 10px; justify-items: center; background: rgba(14,15,18,.5); }
.tb-drop.over { border-color: var(--accent); background: var(--surface-2); }
.tb-drop p { margin: 0; color: var(--text-soft); }
.tb-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-danger { background: transparent; color: #FFB4A8; border: 1px solid #8A3B2F; }
.btn-danger:hover { background: #2A1612; color: #FFD0C8; }
.tb-details { border: 1px solid var(--border); border-radius: 0; padding: 0 14px; margin: 14px 0; }
.tb-details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 10px; color: var(--text-soft); list-style: none; }
.tb-details > summary::-webkit-details-marker { display: none; }
.tb-details > summary::before { content: ''; flex: none; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin: 0 4px 0 2px; }
.tb-details[open] > summary::before { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .tb-details > summary::before { transition: none; } }
.tb-details[open] > summary { margin-bottom: 8px; }
.tb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; padding-bottom: 14px; }
.tb-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tb-files li { border: 1px solid var(--border); border-radius: 0; padding: 10px 12px; display: grid; gap: 4px; }
.tb-files .name { font-family: var(--mono); font-size: 13px; word-break: break-all; color: var(--text); }
.tb-files .meta { font-size: 13px; color: var(--muted); }
.tb-bar { height: 8px; border-radius: 0; background: var(--surface-2); overflow: hidden; }
.tb-bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.tb-tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 0; border: 1px solid var(--border-strong); color: var(--text-soft); margin-right: 6px; }
.tb-ok { color: #8FE3B4; } .tb-bad { color: #FFB4A8; } .tb-warnt { color: var(--warn); }
.tb-msg { padding: 12px 14px; border-radius: 0; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-soft); margin: 12px 0; }
.tb-msg.err { border-color: #8A3B2F; background: #2A1612; color: #FFD0C8; }
.tb-msg.warn { border-color: #8A6A1F; background: #1E1A10; color: var(--warn); }
.tb-msg:empty { display: none; }
.tb-steps { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 12px; padding: 0; }
.tb-steps li { padding: 6px 12px; border-radius: 0; border: 1px solid var(--border-strong); color: var(--muted); font-size: 14px; }
.tb-steps li[aria-current="step"] { border-color: var(--accent); color: var(--text); background: var(--surface-2); }
.tb-steps li.done { color: #8FE3B4; border-color: #2C6B4A; }
.tb-badge { display: inline-block; padding: 3px 10px; font-family: var(--mono); letter-spacing: .04em; border-radius: 0; border: 1px solid var(--accent); color: var(--accent-soft); font-size: 13px; margin-left: 8px; vertical-align: middle; }
.tb-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tb-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 14px; }
.tb-kpi .v { font-size: 26px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tb-kpi .l { font-size: 13px; color: var(--muted); }
.tb-kpi .s { font-size: 12px; color: var(--text-soft); }
.tb-status { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 14px; color: var(--text-soft); margin-bottom: 16px; }
.tb-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.tb-dot.ok { background: #8FE3B4; } .tb-dot.bad { background: #FF7A66; } .tb-dot.wait { background: var(--warn); }
.tb-svg { width: 100%; height: auto; display: block; }
.tb-svg text { font-family: var(--font); fill: var(--text-soft); }
.tb-node { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.5; }
.tb-node.warn { stroke: #F2D58A; stroke-width: 2.5; }
.tb-node.hot { stroke: var(--accent); }
.tb-svg .t1 { fill: var(--text); font-size: 13px; font-weight: 600; }
.tb-svg .t2 { font-size: 11px; fill: var(--muted); }
.tb-svg .t3 { font-size: 12px; fill: var(--accent-soft); font-weight: 600; }
.tb-flow { fill: none; stroke: var(--border-strong); stroke-width: 2; }
.tb-flow.live { stroke: var(--accent); stroke-dasharray: 6 8; animation: tb-dash var(--tb-speed, 1.2s) linear infinite; }
.tb-flow.warn { stroke: #F2D58A; stroke-dasharray: 3 6; }
@keyframes tb-dash { to { stroke-dashoffset: -28; } }
@media (prefers-reduced-motion: reduce) { .tb-flow.live { animation: none; } }
.tb-chartbox { overflow-x: auto; }
.tb-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-soft); margin: 6px 0; }
.tb-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 0; margin-right: 6px; vertical-align: -1px; }
.tb-table-sm { font-size: 13px; min-width: 0; }
.tb-table-sm th, .tb-table-sm td { padding: 8px 10px; }
.tb-table-sm tbody tr.sel { background: var(--surface-2); }
.tb-clickrow { cursor: pointer; }
.tb-clickrow:hover { background: var(--surface-2); }
.tb-pre { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--border); border-radius: 0; padding: 10px; max-height: 280px; overflow: auto; margin: 8px 0; }
.tb-login { max-width: 460px; margin: 40px auto; }
.tb-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .tb-two { grid-template-columns: minmax(0, 1fr); } }


.tb-pals{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:10px;margin-top:10px}
.tb-pal{font:inherit;font-size:14px;text-align:center;cursor:pointer;padding:8px;border-radius: 0;border:2px solid var(--border);background:var(--surface);color:var(--muted)}
.tb-pal i{display:block;height:24px;border-radius: 0;margin-bottom:6px}
.tb-pal small{display:block;font-size:12px;color:var(--muted);line-height:1.3}
.tb-pal:hover{border-color:var(--border-strong)}
.tb-pal.sel{border-color:var(--accent);color:var(--text);font-weight:700}
.tb-pal:focus-visible{outline:2px solid var(--accent-soft);outline-offset:2px}
.page-head .lede { max-width: 46em; }

/* sitewide redesign: heavier card headings, mono data */
.tb-card h2 { font-weight: 800; font-stretch: 106%; letter-spacing: -.01em; }
.tb-label, .tb-table-sm th { font-family: var(--mono); }
.tb-pal.sel { box-shadow: 0 0 0 1px var(--accent); }

.tb-emailrow { flex-wrap: nowrap; align-items: stretch; gap: 8px; }
.tb-emailrow input { flex: 1 1 auto; min-width: 0; }
.tb-emailrow .btn { flex: none; min-height: 44px; }
@media (max-width: 480px) { .tb-emailrow { flex-wrap: wrap; } .tb-emailrow .btn { width: 100%; } }
.tb-verify { margin: 4px 0 8px; }
.tb-verified { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; color: var(--accent); margin: 4px 0 8px; }
.tb-honest { margin: 12px 0 0; color: var(--text-soft); max-width: 40em; }

/* credit tally: before / this job / now */
.tb-tally { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 6px; }
.tb-tally[hidden] { display: none; }
.tb-tal { flex: 1 1 150px; border: 1px solid var(--border-strong); background: var(--surface); padding: 12px 14px; }
.tb-tal.strong { border-color: var(--accent); }
.tb-tal-l { font: 500 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.tb-tal-n { font: 800 22px/1.2 var(--font); margin-top: 4px; }
.tb-tal-c { font-size: 14px; color: var(--muted); }
.tb-tal-note { flex-basis: 100%; margin: 4px 0 0; font-size: 14px; color: var(--text-soft); }

/* ---- /convert/ workspace: shots | preview | settings (layout from the approved prototype, in the UnlockIR look) ---- */
.tb-ws { padding-top: 8px; padding-bottom: 24px; }
.tb-account { margin-bottom: 20px; }
.tb-cols { display: flex; flex-wrap: wrap; align-items: stretch; border: 1px solid var(--border); background: var(--surface); }
.tb-col { min-width: 0; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.tb-shots { flex: 0 0 292px; border-right: 1px solid var(--border); }
.tb-main { flex: 999 1 440px; background: var(--bg); }
.tb-set { flex: 0 0 372px; border-left: 1px solid var(--border); }
.tb-h { margin: 0; font: 500 12px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.tb-mono { font-family: var(--mono); }
.tb-sec { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tb-sec .tb-label { margin: 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
.tb-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-bottom: 8px; }
.tb-grid2 .tb-field { flex: 1 1 auto; }

/* shots column */
.tb-shotlist { gap: 10px; }
.tb-shot, .tb-shot-other { border: 1px solid var(--border); background: var(--bg); padding: 0; display: block; }
.tb-shot.sel { border-color: var(--accent); background: var(--surface-2); }
.tb-shot-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tb-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tb-chip.miss { background: transparent; border-style: dashed; color: var(--muted); }
.tb-chip-note { font-size: 12px; color: var(--warn); margin-left: 4px; }
.tb-shots .tb-drop { padding: 16px 12px; }

/* preview column */
.tb-pv { display: flex; flex-direction: column; gap: 12px; }
.tb-pv-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.tb-pv-head h2 { margin: 0; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.tb-pv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tb-pv-grid figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tb-pv-grid img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; background: #000; display: block; }
#pv-th { filter: url(#tb-palmap); }
.tb-pv-grid figure.empty { border: 1px dashed var(--border-strong); background: var(--surface); min-height: 160px; justify-content: center; align-items: center; text-align: center; padding: 12px; }
.tb-pv-grid figcaption { font-size: 13px; color: var(--muted); }
.tb-colbar { height: 12px; background: var(--iso); }
.tb-collab { display: flex; justify-content: space-between; gap: 12px; font: 12px var(--mono); color: var(--muted); }
.tb-empty { margin: 0; padding: 28px 16px; border: 1px dashed var(--border-strong); color: var(--muted); text-align: center; }
.tb-main .tb-card { margin: 0; }

/* settings column */
.tb-set .tb-pals { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 0; }
.tb-set .tb-pal { padding: 6px; font-size: 13px; }
.tb-set .tb-pal i { height: 18px; margin-bottom: 4px; }
.tb-set .tb-pal small { font-size: 10px; }
.tb-optlist { display: flex; flex-direction: column; gap: 6px; }
.tb-opt, .tb-segb { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border-strong); cursor: pointer; text-align: left; }
.tb-opt { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; min-height: 44px; font-size: 15px; }
.tb-opt-help { font-size: 12px; color: var(--muted); line-height: 1.4; }
.tb-seg, .tb-segs2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tb-segs4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tb-segb { min-height: 44px; padding: 0 8px; text-align: center; font-size: 14px; }
.tb-opt.sel, .tb-segb.sel { border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 1px var(--accent); }
.tb-opt:hover, .tb-segb:hover { border-color: var(--muted); }
.tb-opt:focus-visible, .tb-segb:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.tb-opt[disabled], .tb-segb[disabled], .tb-pal[disabled] { opacity: .55; cursor: not-allowed; }
.tb-set .tb-details { margin: 0; }
.tb-go { width: 100%; min-height: 52px; font-size: 17px; }

@media (max-width: 1120px) {
  .tb-shots, .tb-set { flex: 1 1 100%; border: 0; }
  .tb-main { flex: 1 1 100%; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
}
@media (max-width: 560px) {
  .tb-pv-grid { grid-template-columns: minmax(0, 1fr); }
  .tb-col { padding: 16px; }
}

.tb-set .tb-check { align-items: flex-start; padding-top: 6px; }
.tb-set .tb-check input { margin-top: 2px; flex: none; }

.tb-comp { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--accent); background: var(--surface-2); }
.tb-comp[hidden] { display: none; }

/* queue: a summary row with an expander, then one compact row per shot */
.tb-queue { border: 1px solid var(--border); background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.tb-qhead { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; }
.tb-qsum { margin: 0; flex: 1 1 200px; font: 13px var(--mono); color: var(--text-soft); }
.tb-qtoggle { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 1px solid var(--border-strong); color: var(--text); cursor: pointer; flex: none; }
.tb-qtoggle:hover { border-color: var(--accent); }
.tb-qtoggle svg { transition: transform .15s; }
.tb-qtoggle.open svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .tb-qtoggle svg { transition: none; } }
.tb-queue .tb-shotlist { gap: 4px; max-height: 340px; overflow-y: auto; }
.tb-queue .tb-shotlist[hidden] { display: none; }
.tb-qlegend { margin: 0; }
.tb-shot, .tb-shot-other { border: 1px solid var(--border); background: var(--bg); padding: 0; display: block; }
.tb-qrow { display: flex; align-items: stretch; }
.tb-shot-btn { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 10px 4px 4px; background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.tb-shot-btn.tb-plain { cursor: default; padding-left: 10px; }
.tb-shot-th { width: 40px; height: 32px; object-fit: cover; background: #000; flex: none; }
.tb-shot-name { font-size: 12px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-chip { width: 20px; height: 20px; font-size: 10px; }
.tb-qstate { flex: none; font: 11px var(--mono); color: var(--muted); min-width: 0; }
.tb-qstate:empty { display: none; }
.tb-rm { flex: none; width: 44px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-left: 1px solid var(--border); color: var(--muted); cursor: pointer; }
.tb-rm:hover:not([disabled]) { color: #FFB4A8; background: #2A1612; }
.tb-rm[disabled] { opacity: .35; cursor: not-allowed; }
.tb-rm:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tb-shot .tb-bar { height: 3px; }
.tb-pv-nav { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.tb-pv-nav button { width: 44px; height: 44px; font: 22px/1 var(--font); background: none; border: 1px solid var(--border-strong); color: var(--text); cursor: pointer; }
.tb-pv-nav button:hover:not([disabled]) { border-color: var(--accent); }
.tb-pv-nav button[disabled] { opacity: .4; cursor: not-allowed; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 560px) { .tb-qstate { display: none; } .tb-shot-btn { gap: 8px; } }
.tb-files .tb-shot, .tb-files .tb-shot-other { padding: 0; display: block; gap: 0; }
.tb-files .tb-shot-other { padding: 0; }
.tb-qrow .tb-shot-btn { padding: 4px 10px 4px 4px; }
.tb-done { border-color: var(--accent); }
.tb-done[hidden] { display: none; }
