/* OCR — the same look as the dev tools (/tools/dev/app.css): dark by default, light when the system is light. */
[hidden] { display: none !important; }
:root {
  --bg: #0e0f11; --panel: #131416; --panel2: #17181b; --hover: #1c1d21; --active: #22242a; --border: #25272c; --border2: #2f3238;
  --fg: #e8e9eb; --muted: #8b9098; --faint: #5d626b; --accent: #6e79d6; --accent-fg: #fff; --accent-soft: rgba(110,121,214,.16);
  --ok: #4cb782; --warn: #f2c94c; --err: #eb5757; --code: #0b0c0e; --sel: rgba(110,121,214,.28);
  --fs: 13px; --row: 30px; --sidebar: 232px;
  color-scheme: dark;
}
html.sys-light {
  --bg: #fbfbfc; --panel: #f4f5f7; --panel2: #ffffff; --hover: #eceef1; --active: #e4e7ec; --border: #e3e5ea; --border2: #d3d7de;
  --fg: #1c1d20; --muted: #5f6672; --faint: #8e95a1; --accent: #5561c7; --accent-soft: rgba(85,97,199,.12); --code: #f1f2f5; --sel: rgba(85,97,199,.2);
  --ok: #1f8f5f; --warn: #a77a00; --err: #cc3a3a; color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: var(--fs)/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
::selection { background: var(--sel); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
h2 { font-size: 16px; margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 12px; }

/* shell */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.app.collapsed { grid-template-columns: minmax(0, 1fr); }
.app.collapsed .sidebar { display: none; }
.sidebar { background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; font-weight: 600; }
.brand .logo { width: 20px; height: 20px; border-radius: 5px; flex: none; }
.brand small { color: var(--faint); font-weight: 400; margin-left: auto; }
.nav { overflow: auto; padding: 0 6px 8px; flex: 1; min-height: 0; }
.nav h6 { margin: 14px 8px 4px; font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .6px; }
.nav a { display: flex; align-items: center; gap: 8px; height: var(--row); padding: 0 8px; border-radius: 6px; color: var(--muted); white-space: nowrap; text-decoration: none; }
.nav a:hover { background: var(--hover); color: var(--fg); }
.nav a[aria-current="page"] { background: var(--active); color: var(--fg); }
.nav .dot { width: 6px; height: 6px; border-radius: 2px; background: var(--accent); flex: none; visibility: hidden; }
.nav a[aria-current="page"] .dot { visibility: visible; }
.nav .nt { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav .cnt { color: var(--faint); font-size: 11.5px; }
.nav .cnt:not(:empty) { background: var(--panel2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; }
.sidefoot { border-top: 1px solid var(--border); padding: 6px; display: grid; gap: 4px; }
.sidepromo { margin: 4px 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel2); display: grid; gap: 4px; }
.sidepromo .sp-head { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.sidepromo .sp-link { display: grid; gap: 1px; text-decoration: none; color: inherit; padding: 3px 4px; border-radius: 6px; }
.sidepromo .sp-link b { font-size: 12.5px; color: var(--accent); } .sidepromo .sp-link span { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.sidepromo .sp-link:hover { background: var(--hover); }
.back { padding: 4px 8px; font-size: 12.5px; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 8px; border-bottom: 1px solid var(--border); flex: none; min-width: 0; }
.crumb { color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; white-space: nowrap; }
.crumb a { color: var(--muted); } .crumb b { color: var(--fg); font-weight: 600; }
.crumb .ci { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex: none; }
.crumb .ci.last { flex: 0 1 auto; }
.crumb .ci.mid a { max-width: 16em; }
.crumb .ci.mid a, .crumb .ci.last b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumb .ci.more { display: none; }
.crumbmore { font: inherit; color: var(--muted); background: var(--panel2); border: 1px solid var(--border2); border-radius: 6px; padding: 0 7px; line-height: 20px; cursor: pointer; }
.crumbmore:hover, .crumbmore[aria-expanded="true"] { color: var(--fg); background: var(--hover); }
.crumbnote { color: var(--muted); font-size: 12.5px; min-width: 0; flex: 1 1 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbnote:not(:empty)::before { content: "—"; margin-right: 8px; color: var(--faint); }
.spacer { flex: 1; }
.topbar .spacer { display: none; }   /* the note (flex 1 1 0) takes what the path leaves and pushes the actions right */
.topacts { display: flex; gap: 6px; flex: none; }
.view { flex: 1; min-height: 0; overflow: auto; padding: 20px 24px 32px; outline: none; }
.scrim { position: fixed; inset: 0; z-index: 19; background: rgba(0,0,0,.45); }
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 20; transform: translateX(-100%); transition: transform .15s; }
  .app.navopen .sidebar { transform: none; }
  .crumbnote { display: none; }
  .view { padding: 14px 12px 24px; }
  .topacts .btn { padding: 0 8px; }
  /* phone top bar: the path first (short, or the whole path wrapped after "…"); the actions beside it, or on a second line when they do not fit */
  .topbar { flex-wrap: wrap; height: auto; min-height: 44px; padding: 4px 12px 4px 4px; row-gap: 2px; }
  .crumb { flex: 1 1 auto; max-width: calc(100% - 48px); min-height: 36px; }   /* stays beside the menu button */
  .crumb .ci.mid { display: none; }
  .crumb .ci.more { display: inline-flex; }
  .crumb.full { flex-wrap: wrap; white-space: normal; row-gap: 2px; padding: 6px 0; }
  .crumb.full .ci.mid { display: inline-flex; }
  .crumb.full .ci, .crumb.full .ci.mid a, .crumb.full .ci.last b { min-width: 0; overflow-wrap: anywhere; overflow: visible; }
  .topacts { flex: 0 1 auto; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
  .topacts:empty { display: none; }
}

/* buttons, inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--border2); background: var(--panel2); border-radius: 6px; cursor: pointer; white-space: nowrap; color: var(--fg); text-decoration: none; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 500; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--fg); }
.btn.danger { color: var(--err); }
.btn.mini { height: 24px; padding: 0 8px; font-size: 12px; }
.btn.big { height: 36px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: default; }
input[type=search], input[type=number] { height: 30px; background: var(--bg); border: 1px solid var(--border2); border-radius: 6px; padding: 0 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.next { margin-top: 12px; }
.seggrp { display: inline-flex; flex-wrap: wrap; }
.seg { height: 28px; padding: 0 10px; border: 1px solid var(--border2); background: var(--panel2); color: var(--fg); cursor: pointer; margin-left: -1px; }
.seg:first-child { border-radius: 6px 0 0 6px; margin-left: 0; } .seg:last-child { border-radius: 0 6px 6px 0; }
.seg[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); position: relative; }
.seg[disabled] { opacity: .45; cursor: not-allowed; }
.keep { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); cursor: pointer; }

/* cards, callouts */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; margin: 0 0 16px; }
.card p { margin: 0 0 10px; color: var(--muted); }
.callout { border: 1px solid var(--border); border-left: 3px solid var(--warn); background: var(--panel); border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.callout b { color: var(--fg); }
.callout.ok { border-left-color: var(--ok); }
.empty { color: var(--muted); padding: 30px 0; }
h3.sec { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--faint); margin: 18px 0 8px; }
.consentnote { font-size: 12.5px; border: 1px solid var(--border); border-left: 3px solid var(--warn); background: var(--panel); border-radius: 8px; padding: 10px 12px; color: var(--muted); max-width: 820px; }

/* Add files */
.addview { max-width: 980px; }
.gate .choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 4px; }
.gate .choice { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.gate .choice .muted { font-size: 12px; }
.gate .wait { color: var(--warn); font-weight: 600; }
@media (max-width: 640px) { .gate .choices { grid-template-columns: 1fr; } }
.gate.shake { animation: shake .4s; border-color: var(--accent); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.drop { border: 2px dashed var(--border2); border-radius: 12px; padding: 48px 18px; text-align: center; cursor: pointer; margin: 0 0 12px; background: var(--panel); }
.drop:hover, .drop:focus-visible { border-color: var(--accent); outline: none; }
.drop .dicon { font-size: 30px; color: var(--accent); line-height: 1; margin-bottom: 8px; }
.drop .dt { font-weight: 600; font-size: 15px; }
.drop .ds { color: var(--muted); margin-top: 4px; }
.drop.locked { opacity: .5; cursor: not-allowed; border-style: dotted; }
.drop.locked:hover { border-color: var(--border2); }
.limits { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.dropcover { position: fixed; inset: 0; z-index: 70; background: color-mix(in srgb, var(--accent) 22%, transparent); border: 3px dashed var(--accent); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 600; color: var(--fg); pointer-events: none; }

/* Queue */
.qlist { display: grid; gap: 8px; max-width: 1100px; }
.qrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.qrow.q-failed { border-left: 3px solid var(--err); } .qrow.q-running { border-left: 3px solid var(--accent); } .qrow.q-done { border-left: 3px solid var(--ok); }
.qthumb { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; background: var(--bg); border: 1px solid var(--border); }
.qthumb.ph, .fthumb.ph { display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--faint); }
.qmain { min-width: 0; display: grid; gap: 4px; }
.qhead { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.qname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qhead .muted { font-size: 12px; white-space: nowrap; }
.qs { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qacts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.prog { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.q-done .bar { background: var(--ok); }
@media (max-width: 640px) { .qrow { grid-template-columns: 40px minmax(0, 1fr); } .qacts { grid-column: 1 / -1; justify-content: flex-start; }
  .qhead { flex-wrap: wrap; row-gap: 0; } .qname, .qhead .muted { max-width: 100%; } .qhead .muted { overflow: hidden; text-overflow: ellipsis; } }   /* the name first, its folder and size below */

/* Results */
.fbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }
.fbar input[type=search] { flex: 1; min-width: 200px; max-width: 420px; }
.keepnote { margin: 0 0 12px; max-width: 900px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.fcard { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 8px; color: inherit; text-decoration: none; }
.fcard:hover { border-color: var(--accent); text-decoration: none; }
.fthumb { width: 72px; height: 90px; object-fit: cover; object-position: top; border-radius: 4px; background: var(--bg); border: 1px solid var(--border); }
.fmeta { display: grid; gap: 2px; min-width: 0; align-content: start; }
.fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsnip { color: var(--faint); font-size: 12px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* one file */
.fvbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.fview { display: grid; gap: 14px; }
.fview.side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: calc(100dvh - 44px - 74px - 100px); min-height: 420px; }
.fview.stack { grid-template-columns: minmax(0, 1fr); }
.pv, .tpane { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px; min-height: 0; display: flex; flex-direction: column; }
.pvimg { max-width: 100%; max-height: 100%; object-fit: contain; margin: auto; display: block; background: #fff; }
.fview.stack .pvimg { max-height: 60vh; }
.pvhead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.pvhead .pgjump { width: 64px; height: 24px; padding: 0 6px; }
.pvcanvas { flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; align-items: flex-start; }
.pvpage { max-width: 100%; height: auto; box-shadow: 0 1px 6px rgba(0,0,0,.3); background: #fff; }
.fview.stack .pvcanvas { max-height: 70vh; }
.thead { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.out { width: 100%; flex: 1; min-height: 240px; font: 13px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; padding: 10px; border: 1px solid var(--border2); border-radius: 6px; background: var(--code); color: var(--fg); resize: vertical; }
.out.view { white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; }
.fview.stack .out { max-height: 70vh; }
.pgmark { display: inline-block; color: var(--faint); font-weight: 600; margin-top: 6px; }
a.lnk { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; background: var(--accent-soft); border-radius: 3px; cursor: pointer; }
a.lnk:hover { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* settings */
.srow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); max-width: 1000px; }
.srow .stext { display: grid; gap: 2px; }
.srow.flash { background: var(--accent-soft); border-radius: 6px; }
@media (max-width: 760px) { .srow { grid-template-columns: 1fr; gap: 8px; } }

/* device test */
.steps { list-style: none; padding: 0; margin: 0 0 12px; max-width: 820px; }
.steps li { position: relative; padding: 5px 0 5px 28px; color: var(--muted); }
.steps li::before { content: "○"; position: absolute; left: 4px; top: 5px; color: var(--faint); }
.steps li.active { color: var(--fg); }
.steps li.active::before { content: "◌"; color: var(--accent); animation: spin 1s linear infinite; display: inline-block; }
.steps li.done { color: var(--fg); }
.steps li.done::before { content: "✓"; color: var(--ok); }
@keyframes spin { to { transform: rotate(360deg); } }
.report { max-width: 820px; }
.rating { display: flex; gap: 12px; align-items: flex-start; margin: 6px 0 14px; }
.badge { flex: none; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: var(--border); }
.badge.r-excellent, .badge.r-good { background: var(--ok); color: var(--bg); }
.badge.r-fair, .badge.r-slow { background: var(--warn); color: var(--bg); }
.badge.r-not-ready { background: var(--err); color: var(--bg); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 8px; } }
details summary { cursor: pointer; color: var(--muted); }
pre { overflow: auto; font-size: 12px; background: var(--code); border: 1px solid var(--border); border-radius: 6px; padding: 10px; max-height: 320px; }

/* link check */
.linktip { position: fixed; z-index: 60; max-width: 330px; padding: 6px 10px; border-radius: 8px; background: var(--panel2); color: var(--fg); border: 1px solid var(--border2); border-left: 3px solid var(--faint); box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: 12px; pointer-events: none; }
.linktip.v-ok { border-left-color: var(--ok); } .linktip.v-warn { border-left-color: var(--warn); } .linktip.v-danger { border-left-color: var(--err); }
.dlg { border: 1px solid var(--border2); border-radius: 12px; background: var(--panel); color: var(--fg); padding: 16px 18px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px); }
.dlg::backdrop { background: rgba(0, 0, 0, .55); }
.dlg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dlg-head h2 { flex: 1; margin: 0; }
.dlg .x { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 0 4px; cursor: pointer; }
.dlg-foot { margin-top: 14px; }
.ld-url { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; overflow-wrap: anywhere; background: var(--code); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin: 0 0 10px; }
.ld-state { padding: 10px 12px; border-radius: 6px; border-left: 3px solid var(--faint); background: var(--panel2); }
.ld-state.v-ok { border-left-color: var(--ok); } .ld-state.v-warn { border-left-color: var(--warn); } .ld-state.v-danger { border-left-color: var(--err); }
.ld-state ul, .ld-state ol { margin: 6px 0 0; padding-left: 20px; font-size: 12.5px; }
.hops li { overflow-wrap: anywhere; }

/* footer: 3 lines like the dev tools */
.status { display: flex; flex-direction: column; padding: 2px 16px; border-top: 1px solid var(--border); color: var(--faint); font-size: 11.5px; flex: none; }
.status .ft-line { display: flex; gap: 14px; align-items: center; height: 22px; min-width: 0; white-space: nowrap; }
.status .ft-line > * { flex: none; }
.status .ft-t, .status .spacer { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.status .ft-note, .status .ft-promo { color: var(--muted); }
.status .ft-promo b { color: var(--fg); font-weight: 600; }
.status .ft-ic { width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 9.5px; font-weight: 700; border: 1px solid currentColor; color: var(--faint); }
.status .ft-promo .ft-ic { border: 0; color: var(--accent); font-size: 11px; }
.status .ft-bar { border-top: 1px dashed var(--border); }
.status .lock { color: var(--ok); flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.status .ft-btn { border: 0; background: none; color: inherit; font: inherit; padding: 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.status .ft-ver { font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
@media (max-width: 1150px) { .status .ft-kept { display: none; } }
@media (max-width: 760px) { .status { padding: 2px 10px; } .status .lock, .status .ft-engine { display: none; } .status .ft-line { gap: 10px; } }

/* folders, new files */
.fcrumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; color: var(--faint); }
.fcard.folder { border-style: dashed; }
.ficon { font-size: 26px; color: var(--accent); }
.chip { justify-self: start; font-size: 11px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--border2); color: var(--muted); }
.chip.new, .nav .cnt.new { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

/* menus (Download) */
.menu { position: relative; display: inline-block; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 260px; max-width: calc(100vw - 24px); max-height: min(70vh, 520px); overflow: auto; background: var(--panel2); border: 1px solid var(--border2); border-radius: 8px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.menu-sep { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 8px 8px 2px; }
.menu-item { display: grid; gap: 1px; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--fg); }
.menu-item b { font-weight: 500; } .menu-item span { font-size: 11.5px; color: var(--muted); line-height: 1.3; white-space: normal; }
.menu-item:hover:not([disabled]), .menu-item:focus-visible { background: var(--hover); }
.menu-item[disabled] { opacity: .45; cursor: default; }

/* files added together, and the reading progress in the file view */
.batch { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.bchip { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 2px 9px; border: 1px solid var(--border2); border-radius: 999px; color: var(--fg); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bchip[aria-current="page"] { border-color: var(--accent); background: var(--accent-soft); }
.bchip .bdot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.bchip.b-running .bdot { background: var(--accent); } .bchip.b-done .bdot { background: var(--ok); } .bchip.b-failed .bdot { background: var(--err); }
.inprog { display: grid; gap: 8px; padding: 14px; border: 1px dashed var(--border2); border-radius: 8px; align-content: start; }
.inprog p { margin: 0; }

/* layout: the words at their boxes over the picture */
.pvopts { display: inline-flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.pvopt { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; white-space: nowrap; }
.pgnav { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lwrap { position: relative; width: 100%; max-width: 100%; margin: 0 auto; align-self: flex-start; --k: 1; }
.lwrap .pvimg, .lwrap .pvpage { width: 100%; max-height: none; height: auto; display: block; margin: 0; }
.lwords { position: absolute; inset: 0; display: none; white-space: pre; color: transparent; font-size: 1px; line-height: 1; overflow: hidden; }
.pv.m-layout .lwords { display: block; }
.lw { position: absolute; white-space: pre; line-height: 1; color: transparent; font-family: Arial, Helvetica, sans-serif; font-size: calc(var(--fh) * var(--k) * 1px); transform: scaleX(var(--sx, 1)); transform-origin: 0 0; cursor: text; border-radius: 1px; }
.lw::selection { background: rgba(60,120,255,.4); color: transparent; }
.pv.o-boxes .lw { outline: 1px solid rgba(110,121,214,.9); }
.pv.o-low .lw.lowc { background: rgba(242,150,30,.35); outline: 1px solid rgba(230,120,0,.9); }
.pv.m-layout .lw.fixed { background: rgba(40,170,110,.22); box-shadow: inset 0 -2px 0 rgba(30,150,95,.95); }
.lw.tipon, .lw.kact { outline: 2px solid var(--accent); outline-offset: 1px; }
.lwords:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 0; }
/* the word under the pointer (or the arrow keys): as read, and how sure */
.wtip { position: fixed; z-index: 60; max-width: min(320px, calc(100vw - 12px)); padding: 6px 10px 7px; border-radius: 8px; background: var(--panel2); color: var(--fg); border: 1px solid var(--border2); border-left: 3px solid var(--faint); box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: 12px; pointer-events: none; }
.wtip.pinned { pointer-events: auto; }
.wtip.t-ok { border-left-color: var(--ok); } .wtip.t-low { border-left-color: var(--warn); }
.wt-word { font: 600 15px/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.wt-conf { color: var(--muted); } .t-low .wt-conf { color: var(--warn); }
.wt-was { color: var(--muted); margin-top: 2px; } .wt-hint { color: var(--faint); font-size: 11px; margin-top: 2px; }
.wt-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.fixbox, .fixlog { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; padding: 8px 10px; margin: 0 0 10px; display: grid; gap: 6px; }
.fixlog { border-left-color: var(--ok); }
.fixbox .row, .fixlog .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fixlog .fl-t { min-width: 0; flex: 1 1 260px; }
.fl-list ul { margin: 6px 0 0; padding-left: 18px; max-height: 180px; overflow: auto; font-size: 12.5px; }
.fl-list s { color: var(--muted); }
.pv.m-layout .pvimg, .pv.m-layout .pvpage { -webkit-user-select: none; user-select: none; }
.lnone { position: absolute; left: 8px; bottom: 8px; right: 8px; display: none; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--border2); color: var(--muted); font-size: 12px; }
.pv.m-layout .lnone { display: flex; }
.out.view.nowrap { white-space: pre; overflow-wrap: normal; }
.seg.mini { height: 24px; padding: 0 8px; font-size: 12px; }

/* column select (/tools/colselect.js): with the setting on, outputs do not wrap and show a crosshair */
.colsel-on #tview { cursor: crosshair; white-space: pre !important; overflow-wrap: normal !important; word-break: normal !important; }
