/* PDF Studio - Copy text screen (builder C). Gold = text tools. */
#scr-text { overflow: hidden; }
.tx-work { display: flex; height: 100%; min-height: 0; }
.tx-side {
  flex: 0 0 min(500px, 46%); min-width: 0; overflow: auto; padding: 12px;
  background: var(--t-gold); border-right: 2px solid var(--b-gold);
  display: flex; flex-direction: column; gap: 10px;
}
.tx-view { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; background: var(--stage); }
.tx-viewhint { margin: 0; padding: 6px 12px; font-size: 13px; color: #18212b; background: var(--t-slate); border-bottom: 2px solid var(--b-slate); }

.tx-side .btn { min-height: 44px; }
.tx-side .btn.sm { min-height: 44px; padding: 0 10px; font-size: 14px; }
.tx-side .iconbtn { width: 44px; height: 44px; }
.tx-side .btn.big { font-size: 17px; padding: 0 20px; }
.tx-side .btn.big svg { width: 22px; height: 22px; }

.tx-head, .tx-actions {
  background: #fff; border: 2px solid var(--b-gold); border-radius: var(--radius); padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.tx-sum { margin: 0; font-size: 14px; color: #4a3608; font-weight: 600; }
.tx-opts { border: 1.5px solid var(--b-slate); border-radius: 8px; background: var(--t-slate); }
.tx-opts > summary { cursor: pointer; padding: 10px 12px; font-weight: 700; color: #18212b; min-height: 44px; box-sizing: border-box; display: flex; align-items: center; }
.tx-optbody { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.tx-optbody .row { align-items: flex-end; }
.tx-range { flex: 1 1 160px; margin: 0; }
.tx-dpi { margin: 0; }
.tx-dpi .input { max-width: 150px; }
.tx-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 15px; color: #18212b; min-height: 44px; padding-top: 4px; box-sizing: border-box; }
.tx-check input { width: 22px; height: 22px; flex: 0 0 22px; margin: 1px 0 0; accent-color: var(--accent); }
.tx-check small { display: block; font-size: 13px; color: #4a5868; }

.tx-prog {
  background: var(--t-blue); border: 2px solid var(--b-blue); border-radius: var(--radius); padding: 10px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.tx-prog[hidden] { display: none; }
.tx-prog .msg { flex: 1 1 160px; font-weight: 700; color: #102a4c; }
.tx-prog .bar { flex: 1 1 100%; height: 8px; background: #fff; border: 1.5px solid var(--b-blue); border-radius: 6px; overflow: hidden; }
.tx-prog .bar i { display: block; height: 100%; width: 3%; background: var(--bar-blue); transition: width .3s; }

.tx-find .input { flex: 1 1 150px; min-width: 0; min-height: 44px; }
.tx-count { font-size: 14px; color: #4a5868; min-width: 64px; }

.tx-list { display: flex; flex-direction: column; gap: 10px; }
.tx-pg {
  background: #fff; border: 1.5px solid var(--b-gold); border-left: 6px solid var(--bar-gold);
  border-radius: 8px; padding: 8px 10px 10px;
}
.tx-pg:nth-child(even) { background: #fffcf3; }
.tx-pg.cur { border-color: var(--accent); border-left-color: var(--accent); }
.tx-pg header { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.tx-pg header b { font-size: 15px; }
.tx-pg header .grow { flex: 1 1 auto; }
.tx-badge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 20px; border: 1.5px solid; }
.tx-badge.nat { background: var(--t-green); border-color: var(--b-green); color: #123d22; }
.tx-badge.ocr { background: var(--t-blue); border-color: var(--b-blue); color: #102a4c; }
.tx-badge.low { background: var(--t-rose); border-color: var(--b-rose); color: #6b1a22; }
.tx-badge.err { background: var(--t-rose); border-color: var(--b-rose); color: #6b1a22; }
.tx-badge.wait { background: var(--t-slate); border-color: var(--b-slate); color: #2b3540; }
.tx-out {
  margin: 0; white-space: pre-wrap; word-break: break-word; font: 15px/1.5 Arial, Helvetica, sans-serif;
  color: #18212b; user-select: text; -webkit-user-select: text; cursor: text; max-height: none;
}
.tx-out mark { background: #ffe066; color: #18212b; border-radius: 2px; }
.tx-out mark.cur { background: #ff9f1c; outline: 2px solid #b35c00; }
.tx-none { margin: 0; color: #4a5868; font-style: italic; }

/* select-on-page: invisible words over the page image */
.tx-tl { position: absolute; inset: 0; overflow: hidden; line-height: 1; z-index: 1; }
.tx-tl span {
  position: absolute; white-space: pre; color: transparent; transform-origin: 50% 50%;
  font-family: Arial, Helvetica, sans-serif; cursor: text; user-select: text; -webkit-user-select: text;
}
.tx-tl br { display: none; }
.tx-tl span::selection { background: rgba(29, 79, 145, .35); color: transparent; }
.tx-tl span.hit { background: rgba(255, 214, 0, .45); }

@media (max-width: 760px) {
  #scr-text { overflow: auto; }
  .tx-work { flex-direction: column; height: auto; }
  .tx-side { flex: 0 0 auto; overflow: visible; border-right: 0; border-bottom: 2px solid var(--b-gold); padding: 10px; }
  .tx-view { flex: 0 0 auto; height: calc(var(--vvh, 100dvh) - 110px); min-height: 360px; }
  /* r367 fix round (10/27/2026): on a phone the one primary in each card is filled and full width;
     the escape buttons share one width (two per row, max 260px), centered; a lone one keeps that width. */
  .tx-actions > .row:first-child { justify-content: center; }
  .tx-actions .row .btn { flex: 0 1 calc(50% - 4px); min-width: 0; max-width: 260px; }
  .tx-side .btn.big { flex: 1 1 100%; max-width: none; }
  .tx-head > .row { justify-content: center; }
  .tx-head > .row .btn { flex: 0 1 260px; min-width: 0; }
  .tx-head > .row .btn.primary { flex: 1 1 100%; }
  .tx-pg header .grow { flex: 1 1 100%; height: 0; }
  .tx-pg header .btn.sm { flex: 1 1 0; min-width: 0; } /* Copy / Read / Show page: one equal width */
}
.tx-view .zoombar .iconbtn { width: 44px; height: 44px; }
