/* TrulyRedacted — app shell + document workspace. Tokens and base components come from styles.css.
   App-scoped text tokens (WCAG AA ≥ 4.5:1 for small text, verified with computed styles):
   --ink-3 is darkened for text inside the app; --ok-ink / --warn-ink / --danger-ink / --accent-text are the
   readable text shades of the status colours (the base tokens stay for fills, borders and icons). */
.app-body { --ink-3: #626984; --ok-ink: #096b4e; --warn-ink: #8a5200; --danger-ink: #b01b36; --accent-text: #2f4be6; --hit: 36px; }
[data-theme="dark"] .app-body { --ink-3: #9096ad; --ok-ink: #34d99a; --warn-ink: #ffbb3d; --danger-ink: #ff7387; --accent-text: #8ea2ff; }

/* ---------- shell ---------- */
.app-body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.app-body.modal-open { overflow: hidden; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 200; background: #2f4be6; color: #fff; padding: 8px 14px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 8px; }
.noscript { background: var(--warn-soft); color: var(--ink); padding: 12px 20px; text-align: center; font-weight: 600; }
.app-top { flex: none; gap: 12px; padding-block: 8px; }
.app-top .brand-name { white-space: nowrap; }
.app-top .brand, .app-top .brand .logo, .app-top .ws-switch { flex: none; }
.app-top .top-actions { min-width: 0; }
.ws-switch button { display: inline-flex; align-items: center; gap: 6px; }
.ws-switch svg { width: 16px; height: 16px; }
.mock-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn-ink); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.privacy-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px 5px 9px; border-radius: 999px; background: var(--ok-soft); color: var(--ok-ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; font-family: inherit; line-height: 1.4; }
.privacy-pill:hover { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.privacy-pill:focus-visible { border-color: var(--ok); }
.lang-select { display: none; width: auto; padding: 5px 6px; font-size: 12.5px; font-weight: 700; }
.coffee-link { gap: 6px; }
.app-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; outline: none; }
.ws { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ws[hidden] { display: none; }
.ico { display: inline-flex; }
.muted { color: var(--ink-3); }
.app-body .hint.warn { color: var(--warn-ink); }
.app-body .hint.danger { color: var(--danger-ink); }
.app-body .hint a { color: var(--accent-text); }

/* ---------- empty state ---------- */
.doc-empty { flex: 1; overflow: auto; padding: clamp(16px, 4vw, 48px) clamp(16px, 4vw, 40px); }
.empty-hero { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.dropzone.big { padding: clamp(28px, 6vw, 64px) clamp(16px, 4vw, 48px); display: flex; flex-direction: column; align-items: center; gap: 12px; box-shadow: var(--shadow-xs); }
.dropzone.big h1 { font-size: clamp(24px, 3.4vw, 36px); text-wrap: balance; }
.dropzone.big .dz-sub { max-width: 560px; color: var(--ink-2); margin: 0; font-size: 15.5px; text-wrap: pretty; }
.dz-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.dropzone.big.over .dz-icon { background: var(--accent); color: #fff; }
.btn-row.center { justify-content: center; margin-top: 8px; }
.dz-formats { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-3); }
.dz-paste { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.steps b { display: block; font-family: var(--font-display); font-size: 15px; margin-bottom: 4px; }
.steps p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; font-size: 13px; font-family: var(--font-display); }
.promise { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.promise p { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-2); font-size: 13.5px; margin: 0; }
.promise svg { color: var(--ok); flex: none; }
.promise .proof { font-size: 12px; color: var(--ok-ink); background: var(--ok-soft); padding: 4px 12px; border-radius: 999px; }

/* ---------- workspace grid ---------- */
.doc-grid { --rail-w: 240px; --panel-w: 360px; flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--panel-w); transition: grid-template-columns 0.25s var(--ease); }
.doc-grid.rail-closed { --rail-w: 0px; }
.doc-grid.panel-closed { --panel-w: 0px; }
.doc-grid[hidden] { display: none; }
.rail, .doc-grid > .panel { min-width: 0; overflow: hidden; background: var(--bg-2); display: flex; flex-direction: column; }
.rail { border-right: 1px solid var(--line); }
.doc-grid > .panel { border: 0; border-left: 1px solid var(--line); border-radius: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.doc-grid.rail-closed .rail, .doc-grid.panel-closed .panel { visibility: hidden; }
@media (min-width: 1500px) { .doc-grid { --rail-w: 260px; --panel-w: 400px; } }

/* ---------- rail ---------- */
.rail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 8px; }
.rail-head h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); font-weight: 700; }
.rail-actions { display: flex; gap: 4px; }
.queue { list-style: none; margin: 0; padding: 0 8px 4px; max-height: 42%; overflow: auto; flex: none; }
.q-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 3px 8px; align-items: center; padding: 8px 8px; border-radius: var(--radius-s); cursor: pointer; border: 1px solid transparent; position: relative; }
.q-row + .q-row { margin-top: 2px; }
.q-row:hover { background: var(--glass); }
.q-row.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.q-row:focus-visible { box-shadow: var(--focus); outline: none; }
.q-ico { color: var(--ink-3); display: grid; place-items: center; grid-row: 1; }
.q-row.on .q-ico { color: var(--accent); }
.q-row.error .q-ico { color: var(--danger); }
.q-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.q-meta { grid-column: 2; font-size: 11.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; min-width: 0; }
.q-meta .st { font-weight: 600; }
.q-meta .st.scanning, .q-meta .st.loading, .q-meta .st.exporting { color: var(--accent-text); } .q-meta .st.done { color: var(--ok-ink); } .q-meta .st.error { color: var(--danger-ink); } .q-meta .st.ready { color: var(--ink-2); }
.q-count { grid-column: 3; grid-row: 1; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); background: var(--bg-3); padding: 1px 7px; border-radius: 999px; justify-self: end; }
.q-count:empty { display: none; }
.q-count.has { background: var(--danger-soft); color: var(--danger-ink); }
.q-remove { grid-column: 3; grid-row: 2; justify-self: end; opacity: 0; }
.q-row:hover .q-remove, .q-row.on .q-remove, .q-row:focus-within .q-remove { opacity: 1; }
.q-progress, .q-err, .q-warn, .q-xray { grid-column: 2 / -1; }
.q-progress .progress { height: 4px; }
.q-progress .progress-meta { font-size: 10.5px; }
.q-err { font-size: 12px; color: var(--danger-ink); line-height: 1.35; }
.q-warn { font-size: 11.5px; color: var(--warn-ink); line-height: 1.35; }
.q-xray { justify-self: start; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 1px 7px 1px 5px; border-radius: 999px; background: var(--bg-3); color: var(--ink-2); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-xray.risk-high { background: var(--danger-soft); color: var(--danger-ink); }
.q-xray.risk-medium { background: var(--warn-soft); color: var(--warn-ink); }
.batch-bar { display: flex; flex-direction: column; gap: 6px; padding: 6px 14px 10px; border-bottom: 1px solid var(--line); }
.batch-bar .btn { width: 100%; justify-content: flex-start; white-space: normal; text-align: left; line-height: 1.25; border-radius: 10px; }
.pages-head { border-top: 1px solid var(--line); margin-top: 2px; }
.batch-bar + .pages-head { border-top: 0; }
.thumbs { flex: 1 1 auto; overflow: auto; padding: 4px 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.thumb { position: relative; border: 2px solid var(--line); border-radius: 8px; background: var(--bg-3); cursor: pointer; padding: 0; overflow: hidden; aspect-ratio: var(--ar, 0.707); width: 100%; display: block; flex: none; }
.thumb canvas { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.thumb.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.thumb:focus-visible { box-shadow: var(--focus); outline: none; }
.thumb-n { position: absolute; left: 6px; bottom: 6px; background: var(--ink); color: var(--ink-inv); font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 5px; }
.thumb-dot { position: absolute; right: 6px; top: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger-ink); color: #fff; font-family: var(--mono); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
[data-theme="dark"] .thumb-dot { background: #c0213d; }
.thumb-dot.none { display: none; }
/* page whose scan failed part-way (E-21): warning badge, top-left */
.thumb-warn { position: absolute; left: 6px; top: 6px; width: 20px; height: 20px; border-radius: 10px; background: var(--warn); color: #1d1300; display: grid; place-items: center; font-weight: 800; font-size: 12px; line-height: 1; }
.thumb.incomplete { border-color: var(--warn); }

/* ---------- viewer ---------- */
.viewer { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.vtoolbar { position: relative; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 12px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.vt-group { display: flex; align-items: center; gap: 4px; flex: none; }
.vt-group + .vt-group { padding-left: 8px; border-left: 1px solid var(--line); }
.vt-group.right { margin-left: auto; border-left: 0; gap: 8px; padding-left: 0; }
.vtoolbar .vt-group.nav { margin-left: 0; } /* .nav also styles the landing header (styles.css) */
.page-ind { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.page-ind input { width: 48px; text-align: center; padding: 4px 4px; -moz-appearance: textfield; appearance: textfield; }
.page-ind input::-webkit-outer-spin-button, .page-ind input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.zoom-level { border: 0; background: transparent; font-size: 12.5px; color: var(--ink-2); padding: 4px 6px; border-radius: 6px; min-width: 52px; }
.zoom-level:hover { background: var(--glass); color: var(--ink); }
.tool { position: relative; }
.tool-key { position: absolute; right: -4px; bottom: -5px; font-size: 9px; padding: 0 3px; line-height: 1.4; border-bottom-width: 1px; pointer-events: none; }
#btn-export { position: relative; }
#btn-export .warn-dot { display: none; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--bg); }
#btn-export.has-warn .warn-dot { display: block; }
.tool-hint { display: flex; align-items: center; gap: 8px; padding: 6px 14px; font-size: 12.5px; background: var(--accent-soft); color: var(--accent-text); border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
/* the page is centred with auto margins (not justify-content) so a zoomed page that overflows stays scrollable on both sides */
.stage { flex: 1 1 auto; min-height: 0; overflow: auto; scrollbar-gutter: stable; padding: 20px; display: flex; justify-content: flex-start; align-items: flex-start; outline: none; }
.stage:focus-visible { box-shadow: inset 0 0 0 3px rgba(59, 91, 255, 0.45); }
.stage.tool-draw { cursor: crosshair; }
.stage.tool-draw .overlay { touch-action: none; }
.stage.tool-draw .overlay .rect { pointer-events: none; }
.page-wrap { position: relative; flex: none; margin: 0 auto; box-shadow: var(--shadow-s); background: #fff; border-radius: 2px; }
/* ---------- scrolling & smoothness on phones (2026-10-08 mobile round) ---------- */
/* The app is a fixed-height shell (.app-body = 100dvh, overflow hidden): every workspace must scroll inside itself.
   The video workspace had no scroll container at all → on phones its lower half (timeline, tracks, export) was
   unreachable. Inner scrollers contain their overscroll so a fling never "sticks" or pulls the page to refresh. */
html { overscroll-behavior-y: none; }                       /* no accidental pull-to-refresh (unsaved review work) */
.video-ws { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.video-ws .vw { --vw-top: 0px; }                            /* sticky side panels are relative to this scroller now */
@media (min-width: 901px) { .video-ws .vw-left, .video-ws .vw-right { max-height: calc(100dvh - 96px); } }
.stage, .ptab, .doc-empty, .rail { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.f-list { -webkit-overflow-scrolling: touch; } /* NOT contained: at its ends a swipe continues into the sheet (filters above) */
@media (hover: none), (max-width: 760px) {
  /* backdrop blurs are re-computed on every scroll frame and make phones stutter — use solid surfaces instead */
  .vtoolbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .rect.acc.blur { backdrop-filter: none; -webkit-backdrop-filter: none; background: repeating-linear-gradient(45deg, #b9bdc8 0 6px, #d4d7df 6px 12px); opacity: 0.95; }
  .doc-grid > .panel { transition: height 0.22s ease-out; will-change: height; }
}

/* touch devices: keyboard-shortcut badges (R, S, B …) are noise without a keyboard; the shortcut help list keeps them */
@media (hover: none) and (pointer: coarse) { .tool-key, .vw .kbd:not(.vw-keys .kbd) { display: none !important; } }
/* shown instead of a silent blank page when a page cannot be rendered (old phone browsers, canvas memory limits) */
.viewer-error { position: absolute; z-index: 4; left: 50%; top: 24px; transform: translateX(-50%); width: min(92%, 420px);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-left: 4px solid var(--warn);
  border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-s); font-size: 14px; }
.viewer-error .ve-title { font-weight: 700; margin: 0 0 6px; }
.viewer-error .ve-hint { color: var(--ink-2); margin: 0 0 10px; font-size: 13px; }
.viewer-error .ve-retry { min-height: 40px; }
.page-wrap.preview-after { outline: 3px solid var(--ok); outline-offset: 2px; }
.page-canvas { display: block; max-width: none; }
.page-loading { position: absolute; inset: 0; border-radius: 2px; }
.overlay { position: absolute; inset: 0; overflow: hidden; }
.viewer-empty { align-self: center; margin: auto; }

/* overlay rects — one div per finding rect */
.rect { position: absolute; box-sizing: border-box; border-radius: 2px; cursor: pointer; transition: box-shadow 0.12s, outline-color 0.12s; outline: 2px solid transparent; outline-offset: 1px; }
.rect.acc.black { background: var(--redact); opacity: 0.85; }
.rect.acc.white { background: #fff; opacity: 0.95; border: 1px dashed rgba(0, 0, 0, 0.25); }
.rect.acc.label { background: var(--redact); opacity: 0.9; color: #fff; font-family: var(--mono); font-weight: 600; font-size: var(--fs, 9px); line-height: 1; display: flex; align-items: center; padding: 0 3px; overflow: hidden; white-space: nowrap; }
.rect.acc.pixelate { background-color: rgba(120, 120, 130, 0.4); background-image: repeating-conic-gradient(rgba(60, 60, 70, 0.85) 0 25%, rgba(190, 190, 200, 0.85) 0 50%); background-size: 8px 8px; opacity: 0.85; }
.rect.acc.blur { backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); background: rgba(200, 200, 210, 0.55); opacity: 0.95; }
.rect.rej { background: transparent; border: 2px dashed #6b7089; opacity: 0.85; }
.rect.lowc.acc::after { content: ''; position: absolute; right: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px #fff; }
.rect.hov { outline-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.rect.sel { outline-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); z-index: 2; }
.rect.vision.acc { border-radius: 8px; }
.rect.draft { border: 2px dashed var(--accent); background: var(--accent-soft); pointer-events: none; }
.rect-tools { position: absolute; z-index: 6; display: flex; gap: 2px; padding: 3px; background: var(--ink); border-radius: 9px; box-shadow: var(--shadow-s); }
.rt-btn { width: 30px; height: 30px; border-radius: 6px; border: 0; background: transparent; color: var(--ink-inv); display: grid; place-items: center; }
.rt-btn:hover { background: rgba(127, 127, 127, 0.22); }
.rt-btn.ok:hover { color: var(--ok); } .rt-btn.warn:hover { color: var(--warn); } .rt-btn.danger:hover { color: var(--danger); }
.rt-btn:focus-visible { box-shadow: 0 0 0 2px var(--accent); }

/* ---------- panel ---------- */
.panel-handle { display: none; }
.ptabs { margin: 10px 12px 6px; flex: none; display: flex; }
.ptabs button { flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px; position: relative; padding: 6px 5px; font-size: 12.5px; white-space: nowrap; }
.ptabs button > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.ptabs button[hidden] { display: none; }
.ptabs .count { flex: none; font-size: 11px; background: var(--bg-4); color: var(--ink-2); padding: 0 6px; border-radius: 999px; line-height: 1.6; }
.ptabs .on .count { background: var(--accent-soft); color: var(--accent-text); }
.ptabs .count.risk-high { background: var(--danger-soft); color: var(--danger-ink); }
.ptabs .count.risk-medium { background: var(--warn-soft); color: var(--warn-ink); }
.ptabs .count:empty { display: none; }
.dot-changed { position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.panel-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ptab { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 4px 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.ptab[hidden] { display: none; }
.scan-status { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--accent-soft); font-size: 12.5px; color: var(--accent-text); flex: none; }
.scan-status .progress { height: 4px; }
.scan-status .progress-label { font-weight: 600; }
.scan-status .progress-meta { font-size: 11px; color: var(--ink-2); }
.rescan-hint { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--warn-soft); color: var(--ink); font-size: 12.5px; flex: none; }
.rescan-hint svg { color: var(--warn-ink); flex: none; }
.rescan-hint .btn { margin-left: auto; flex: none; }
.search-tool { padding: 10px 12px; border-radius: var(--radius-s); background: var(--bg-3); border: 1px solid var(--line); flex: none; }
.search-row { display: flex; gap: 6px; margin-top: 6px; }
.search-row input { flex: 1; min-width: 0; }
.search-tool .hint { margin-top: 6px; }

/* review meter */
.f-meter { flex: none; display: flex; flex-direction: column; gap: 6px; }
.fm-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.fm-text { font-size: 12.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.f-meter .chip-review { padding: 3px 9px; font-size: 12px; gap: 5px; }
.f-meter .chip-review.low { border-color: color-mix(in srgb, var(--warn) 60%, transparent); color: var(--warn-ink); background: var(--warn-soft); }
.f-meter .chip-review.on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.fm-bar { height: 4px; }
.fm-bar > i { background: var(--accent); }
.f-meter.complete .fm-bar > i { background: var(--ok); }
.f-meter.complete .fm-text { color: var(--ok-ink); }

/* group chips */
.f-summary { display: flex; flex-wrap: wrap; gap: 6px; flex: none; min-height: 28px; }
.f-summary:empty { min-height: 0; }
.f-summary.reserve { min-height: 62px; } /* two chip rows while a scan streams findings in (no layout shift) */
.chip-menu { position: relative; padding: 0; gap: 0; overflow: visible; }
.chip-main { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: inherit; padding: 4px 4px 4px 9px; border-radius: 999px 0 0 999px; font: inherit; }
.chip-main b { font-family: var(--mono); font-weight: 600; font-size: 12px; }
.chip-main .badge { padding: 0 5px; font-size: 10px; }
.chip-more { border: 0; background: transparent; color: inherit; padding: 4px 7px 4px 3px; border-radius: 0 999px 999px 0; display: grid; place-items: center; }
.chip-more:hover, .chip-more:focus-visible { background: var(--glass); }
.chip-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 9; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-s); padding: 4px; display: flex; flex-direction: column; min-width: 190px; }
.chip-pop button { border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--ink); }
.chip-pop button:hover, .chip-pop button:focus-visible { background: var(--glass); }
.badge-id { color: var(--danger-ink); } .badge-finance { color: var(--warn-ink); } .badge-contact { color: var(--accent-text); }
.badge-vision { color: #0a7a63; } [data-theme="dark"] .badge-vision { color: var(--accent-2); }
.badge-person { color: #6d2fd6; } [data-theme="dark"] .badge-person { color: #b495ff; }

.f-controls { display: flex; gap: 6px; align-items: center; flex: none; }
.f-search { flex: 1; position: relative; min-width: 0; }
.f-search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.f-search input { padding-left: 30px; padding-block: 6px; font-size: 13px; }
.f-controls select { width: auto; max-width: 110px; }
.f-controls .check { padding: 0; }
.f-controls .check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.f-controls .check svg { color: var(--ink-3); padding: 6px; box-sizing: content-box; border: 1px solid var(--line-2); border-radius: var(--radius-xs); }
.f-controls .check input:checked + .sr-only + svg { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.f-controls .check:focus-within svg { box-shadow: var(--focus); }
.f-controls .f-toggle { width: 29px; height: 29px; border-radius: var(--radius-xs); border-color: var(--line-2); }

/* findings list */
.f-list { flex: 1 1 auto; min-height: 140px; overflow: auto; overflow-anchor: none; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); position: relative; outline: none; }
.f-list:focus-visible { box-shadow: var(--focus); }
.f-list .spacer { position: relative; }
.f-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-rows: auto auto; column-gap: 10px; row-gap: 2px; align-items: center; padding: 8px 6px 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; height: 56px; box-sizing: border-box; position: relative; }
.f-row.virt { position: absolute; left: 0; right: 0; }
.f-row:hover, .f-row.hov { background: var(--glass); }
.f-row.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.f-list:focus-visible .f-row.on { box-shadow: inset 3px 0 0 var(--accent), inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.f-row.rej .f-type, .f-row.rej .f-val { color: var(--ink-3); }
.f-row.rej .f-val { text-decoration: line-through; }
.f-row.lowc { box-shadow: inset 3px 0 0 var(--warn); }
.f-row.on.lowc { box-shadow: inset 3px 0 0 var(--accent); }
.f-row .f-check { grid-column: 1; grid-row: 1 / span 2; display: grid; place-items: center; }
.f-row .f-top { grid-column: 2; grid-row: 1; }
.f-row .f-bottom { grid-column: 2; grid-row: 2; }
.f-row .f-right { grid-column: 3; grid-row: 1 / span 2; }
.f-row .f-expand { grid-column: 4; grid-row: 1 / span 2; }
.f-check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; cursor: pointer; display: block; }
.f-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.f-type { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.f-count { font-size: 11.5px; font-weight: 600; color: var(--accent-text); white-space: nowrap; flex: none; }
.f-count:empty { display: none; }
.f-page { font-family: var(--mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.f-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--ink-2); }
.f-bottom .badge { flex: none; font-size: 9.5px; padding: 0 5px; line-height: 1.6; }
.f-val { font-family: var(--mono); font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.f-val.masked { letter-spacing: 0.02em; }
.f-eye { border: 0; background: transparent; color: var(--ink-3); padding: 2px; display: grid; place-items: center; border-radius: 4px; flex: none; }
.f-eye:hover { color: var(--ink); background: var(--glass); }
.f-src { color: var(--ink-3); display: inline-flex; flex: none; }
.f-valid { font-family: var(--mono); font-size: 11px; flex: none; }
.f-valid.ok { color: var(--ok-ink); } .f-valid.bad { color: var(--danger-ink); }
.f-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.f-right .conf span { color: var(--ink-2); }
.f-review { font-size: 10.5px; color: var(--warn-ink); font-weight: 600; white-space: nowrap; }
.f-review:empty { display: none; }
.f-expand { width: 26px; height: 26px; border: 0; background: transparent; border-radius: 6px; color: var(--ink-3); display: grid; place-items: center; padding: 0; }
.f-expand:hover { background: var(--glass); color: var(--ink); }
.f-expand svg { transition: transform 0.15s; }
.f-expand.open svg { transform: rotate(180deg); }
.f-expand[hidden] { display: grid; visibility: hidden; }
.f-row.child { height: 40px; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-rows: auto; padding: 4px 10px 4px 34px; background: var(--bg-2); column-gap: 10px; }
.f-row.child .f-check { grid-row: 1; }
.f-row.child .f-page { grid-column: 2; }
.f-row.child .f-val { grid-column: 3; font-size: 11.5px; color: var(--ink-2); }
.f-row.child .conf { grid-column: 4; }
.f-row.child.on { background: var(--accent-soft); }
.f-empty { padding: 28px 16px; text-align: center; color: var(--ink-3); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.f-empty b { display: block; color: var(--ink-2); }
.disclaimer { font-size: 11.5px; color: var(--ink-3); line-height: 1.45; margin: 0; flex: none; }
.conf span { min-width: 3.4em; text-align: right; }

/* X-ray */
.xray-card { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: var(--radius-s); border: 1px solid var(--line-2); background: var(--surface); flex: none; }
.xray-card .xc-ico { color: var(--ink-3); display: grid; place-items: center; flex: none; }
.xray-card .xc-text { display: flex; flex-direction: column; min-width: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.xray-card .xc-text b { color: var(--ink); font-size: 13px; }
.xray-card .btn { margin-left: auto; flex: none; }
.xray-card.risk-high { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 5%, var(--surface)); }
.xray-card.risk-high .xc-ico { color: var(--danger-ink); }
.xray-card.risk-medium { border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn) 6%, var(--surface)); }
.xray-card.risk-medium .xc-ico { color: var(--warn-ink); }
.xray-head h3 { font-size: 16px; margin-bottom: 2px; }
.xray-risk { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--bg-3); font-size: 12.5px; color: var(--ink-2); }
.xray-risk div { display: flex; flex-direction: column; }
.xray-risk b { font-size: 14px; color: var(--ink); }
.xray-risk.risk-high { background: var(--danger-soft); } .xray-risk.risk-high svg { color: var(--danger-ink); }
.xray-risk.risk-medium { background: var(--warn-soft); } .xray-risk.risk-medium svg { color: var(--warn-ink); }
.xray-risk.risk-none, .xray-risk.risk-low { background: var(--ok-soft); } .xray-risk.risk-none svg, .xray-risk.risk-low svg { color: var(--ok-ink); }
.xray-group h4 { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 4px 0 4px; }
.xray-group h4 svg { color: var(--ink-3); }
.xray-group h4 .cat-n { margin-left: auto; font-size: 11px; color: var(--ink-3); font-weight: 500; }
.xray-group > .hint { font-size: 12px; margin-bottom: 6px; }
.xray-items { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.xray-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 10px; font-size: 12.5px; }
.xray-item + .xray-item { border-top: 1px solid var(--line); }
.sev-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: var(--ink-3); }
.sev-dot.sev-high { background: var(--danger); } .sev-dot.sev-warn { background: var(--warn); } .sev-dot.sev-info { background: var(--accent); }
.xi-title { display: flex; gap: 6px; align-items: baseline; font-weight: 600; color: var(--ink); }
.xi-title .f-page { flex: none; }
.xi-detail { font-size: 11.5px; color: var(--ink-2); word-break: break-word; margin-top: 2px; }
.xi-fate { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; white-space: nowrap; padding: 1px 7px; border-radius: 999px; }
.xi-fate.ok { color: var(--ok-ink); background: var(--ok-soft); }
.xi-fate.kept { color: var(--warn-ink); background: var(--warn-soft); }
.xi-fate.unknown { color: var(--ink-2); background: var(--bg-3); }

/* result + support cards */
.result-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-xs); flex: none; }
.result-card.ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.result-card.bad { border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.result-card.running { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.rc-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-family: var(--font-display); font-size: 14.5px; }
.result-card.ok .rc-head { color: var(--ok-ink); } .result-card.bad .rc-head { color: var(--danger-ink); }
.rc-head .rc-close { margin-left: auto; flex: none; }
.rc-name { font-size: 12px; color: var(--ink-3); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -6px; }
.rc-summary { margin: 0; font-size: 13px; color: var(--ink); line-height: 1.45; }
.rc-details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; margin: 0; font-size: 12.5px; padding: 8px 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-xs); }
.rc-kv { display: contents; }
.rc-kv dt { color: var(--ink-3); }
.rc-kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.rc-kv.ok dd { color: var(--ok-ink); font-weight: 600; } .rc-kv.bad dd { color: var(--danger-ink); font-weight: 600; }
.rc-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
.rc-notes li { display: flex; gap: 6px; align-items: flex-start; }
.rc-notes svg { flex: none; margin-top: 2px; color: var(--ink-3); }
.rc-notes li.warn { color: var(--warn-ink); } .rc-notes li.warn svg { color: var(--warn-ink); }
.result-card .keep-front { font-size: 12px; color: var(--ink-2); margin: 6px 0 0; }
.result-card .keep-front.warn { color: var(--warn-ink); font-weight: 600; }
.rc-leaks { margin: 0; padding: 8px 10px; border-radius: var(--radius-xs); background: var(--danger-soft); font-size: 12px; color: var(--danger-ink); display: flex; flex-direction: column; gap: 4px; }
.rc-leaks li { list-style: none; font-family: var(--mono); }
.rc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-actions .btn { padding-inline: 12px; }
.rc-report { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-3); border-radius: 999px; padding: 2px; }
.rc-report .lbl { font-size: 12px; color: var(--ink-2); padding: 0 6px 0 10px; display: inline-flex; align-items: center; gap: 4px; }
.rc-report button { border: 0; background: transparent; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; font-family: var(--mono); color: var(--ink-2); }
.rc-report button:hover { background: var(--bg-2); color: var(--ink); }
.rc-copy { display: flex; }
.support-card { border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); border-radius: var(--radius); padding: 14px; display: flex; gap: 12px; align-items: flex-start; flex: none; }
.support-card .sc-emoji { font-size: 26px; line-height: 1; }
.support-card h3 { font-size: 15px; margin-bottom: 2px; }
.support-card p { font-size: 12.5px; color: var(--ink-2); margin: 0 0 10px; }
.support-card .btn-row { gap: 6px; }

/* settings panels */
.set-section { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.set-section:first-child { border-top: 0; }
.set-section > h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.set-section > h3 .hint { text-transform: none; letter-spacing: 0; font-weight: 500; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-chips .chip.foreign { opacity: 0.85; }
.cat-group { border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.cat-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg-3); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; }
.cat-head:focus-visible { box-shadow: inset var(--focus); }
.cat-toggle { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; min-height: 24px; cursor: pointer; font: inherit; color: inherit; border-radius: 4px; }
.cat-toggle:focus-visible { box-shadow: var(--focus); }
.cat-head .cat-n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.cat-head .chev { transition: transform 0.2s; display: inline-flex; }
.cat-group.open .cat-head .chev { transform: rotate(180deg); }
.cat-head .switch { margin-left: 6px; }
.cat-body { display: none; flex-direction: column; padding: 4px 10px; }
.cat-head .cat-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-group.countries > .cat-body { gap: 6px; padding: 8px; }
.cat-group.nested { border-radius: var(--radius-xs); }
.cat-group.nested > .cat-head { background: var(--bg-2); font-weight: 500; }
.sample-alt { font-size: 13px; margin-top: -2px; }
.cat-group.open .cat-body { display: flex; }
.sw-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13.5px; border-top: 1px solid var(--line); }
.sw-row:first-child { border-top: 0; }
.sw-row .sw-text { display: flex; flex-direction: column; min-width: 0; cursor: pointer; }
.sw-row .hint { font-size: 11.5px; }
.sw-row.main { font-weight: 600; border-top: 0; }
textarea.terms { min-height: 72px; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
.style-seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.style-seg button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 3px; border: 1px solid var(--line-2); border-radius: var(--radius-xs); background: var(--bg-2); font-size: 11px; font-weight: 600; color: var(--ink-2); min-width: 0; line-height: 1.15; text-align: center; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
.style-seg button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.style-seg .sw { width: 100%; height: 14px; border-radius: 3px; display: block; }
.sw-black { background: var(--redact); } .sw-white { background: #fff; border: 1px dashed rgba(0, 0, 0, 0.3); }
.sw-label { background: var(--redact); color: #fff; font-family: var(--mono); font-size: 8px; display: grid; place-items: center; line-height: 1; }
.sw-pixelate { background-image: repeating-conic-gradient(#404048 0 25%, #c0c0c8 0 50%); background-size: 6px 6px; }
.sw-blur { background: linear-gradient(90deg, #9aa0b0, #cfd3dd, #9aa0b0); filter: blur(1.5px); }
.style-preview { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-xs); font-size: 12.5px; color: #333; font-family: Georgia, 'Times New Roman', serif; }
.style-preview .pv { display: inline-block; height: 14px; width: 92px; vertical-align: middle; position: relative; }
.style-preview .pv.wide { width: auto; min-width: 70px; }
.style-preview .pv.black { background: #0b0d14; } .style-preview .pv.white { background: #fff; outline: 1px dashed rgba(0,0,0,0.3); }
.style-preview .pv.label { background: #0b0d14; color: #fff; font-family: var(--mono); font-size: 8.5px; display: inline-flex; align-items: center; padding: 0 4px; }
.style-preview .pv.pixelate { background-image: repeating-conic-gradient(#404048 0 25%, #c0c0c8 0 50%); background-size: 7px 7px; }
.style-preview .pv.blur { background: linear-gradient(90deg, #8a90a0, #d0d4de, #8a90a0); filter: blur(2px); }
.label-opts { display: grid; grid-template-columns: 1fr; gap: 0; }
.label-opts .field { margin-bottom: 8px; }
.dpi-seg button { flex: 1; }
.set-footer { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.set-footer .btn { width: 100%; }

/* ---------- help sheet ---------- */
.shortcuts h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin: 14px 0 6px; }
.shortcuts h4:first-child { margin-top: 0; }
.shortcut-list { display: flex; flex-direction: column; margin: 0; }
.shortcut-row { display: grid; grid-template-columns: 136px 1fr; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.shortcut-row dd { margin: 0; color: var(--ink-2); }
.shortcut-keys { display: flex; gap: 4px; flex-wrap: wrap; }
.shortcut-toggle { margin-top: 14px; border-top: 0; padding-top: 10px; }
.modal { position: relative; }
.modal.wide { width: min(760px, 100%); }
.modal-close { position: absolute; right: 14px; top: 14px; }
.modal h3 { padding-right: 36px; }
.modal-body { font-size: 14.5px; color: var(--ink-2); line-height: 1.55; white-space: pre-line; }
.modal-body .shortcuts, .modal-body .pw-form { white-space: normal; }
.pw-form { display: flex; flex-direction: column; gap: 8px; }
.pw-form p { margin: 0; }
.pw-form input { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-xs); padding: 9px 11px; color: var(--ink); font: inherit; }
.pw-form input:focus { border-color: var(--accent); box-shadow: var(--focus); outline: none; }
.pw-form input[aria-invalid="true"] { border-color: var(--danger); }
.modal-backdrop.out, .toast.out { opacity: 0; transition: opacity 0.15s; }

/* ---------- toasts extras ---------- */
.toast-ico { flex: none; }
.toast.ok .toast-ico { color: var(--ok); } .toast.warn .toast-ico { color: var(--warn); } .toast.danger .toast-ico { color: var(--danger); }
.toast-text { flex: 1; min-width: 0; }
.toast-action { border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.14); color: inherit; border-radius: 8px; padding: 5px 12px; font-weight: 700; font-size: 13px; white-space: nowrap; min-height: 30px; }
.toast-action:hover { background: rgba(255, 255, 255, 0.24); }
.toast-close { border: 0; background: transparent; color: inherit; opacity: 0.8; display: grid; place-items: center; padding: 4px; border-radius: 6px; flex: none; }
.toast-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }
.toast-action:focus-visible, .toast-close:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
[data-theme="dark"] .toast-action { border-color: rgba(0, 0, 0, 0.3); background: rgba(0, 0, 0, 0.1); }
[data-theme="dark"] .toast-close:hover { background: rgba(0, 0, 0, 0.12); }
@media (min-width: 761px) { .toasts { left: auto; right: 20px; transform: none; bottom: 20px; width: min(420px, calc(100vw - 40px)); } }

/* ---------- coach marks ---------- */
.coach { position: fixed; z-index: 95; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px 12px; animation: toastin 0.2s var(--ease); }
.coach h3 { font-size: 15.5px; margin: 2px 0 6px; }
.coach p { font-size: 13px; color: var(--ink-2); margin: 0 0 12px; line-height: 1.5; }
.coach-step { font-size: 11px; color: var(--ink-3); }
.coach-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.coach-actions .coach-skip { margin-right: auto; font-size: 12.5px; }
.coach-arrow { position: absolute; width: 12px; height: 12px; background: var(--surface); border: 1px solid var(--line-2); transform: rotate(45deg); }
.coach[data-side="right"] .coach-arrow { right: -7px; border-left: 0; border-bottom: 0; }
.coach[data-side="top"] .coach-arrow { top: -7px; border-right: 0; border-bottom: 0; }
.coach[data-side="bottom"] .coach-arrow { bottom: -7px; border-left: 0; border-top: 0; }
.coach-arrow[hidden] { display: none; }
.coach-ring { position: fixed; z-index: 94; border-radius: 12px; box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(8, 10, 20, 0.28); pointer-events: none; transition: all 0.2s var(--ease); }

/* coming-soon card (video module missing) */
.coming-soon { margin: auto; max-width: 480px; text-align: center; padding: 40px 28px; }
.coming-soon svg { width: 44px; height: 44px; color: var(--accent); margin: 0 auto 12px; }
.coming-soon h2 { font-size: 22px; margin-bottom: 8px; }

/* global drag highlight */
.app-body.over .doc-grid::after { content: ''; position: fixed; inset: 0; pointer-events: none; border: 3px dashed var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); z-index: 50; }

/* progress widget */
.progress-wrap { display: flex; flex-direction: column; gap: 4px; }
.progress-label { font-size: 12px; }
.progress-meta { font-size: 11px; color: var(--ink-3); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  /* rail and panel are mutually exclusive here (index.js closes one when the other opens) */
  .doc-grid { --rail-w: 220px; --panel-w: 340px; }
  /* labels collapse to icons but stay in the accessibility tree (visually hidden, not display:none) */
  .privacy-pill span, .coffee-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .privacy-pill { padding: 7px; }
  .coffee-link { padding: 6px 9px; }
  .vt-group + .vt-group { padding-left: 6px; }
  .vtoolbar { padding: 6px 10px; }
}
@media (max-width: 900px) {
  .vt-group.zoom #btn-fit-page { display: none; }
  #btn-export span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  #btn-export { padding: 0; width: 34px; height: 34px; border-radius: 10px; }
}
@media (max-width: 760px) {
  .app-body { --hit: 40px; }
  .app-top { gap: 6px; padding-inline: 12px; padding-block: 6px; }
  .app-top .brand { min-height: 40px; min-width: 40px; justify-content: center; }
  .app-top .ws-switch { min-width: 0; flex: 0 1 auto; padding: 2px; }
  .app-top .ws-switch button { padding: 8px 9px; min-height: 40px; font-size: 13px; }
  .skip { padding: 10px 14px; }
  .sample-alt { min-height: 40px; }
  .app-top .ws-switch svg { display: none; }
  .mock-badge { display: none; }
  .brand-name { display: none; }
  .app-top .lang { display: none; }
  .app-top .lang-select { display: block; min-height: 40px; flex: none; }
  .app-top .coffee-link, .app-top #help-btn { display: none; } /* phones: no keyboard shortcuts; coffee card shows after export */
  .app-top .top-actions { gap: 6px; }
  .app-top .btn-icon, .privacy-pill { width: 40px; height: 40px; justify-content: center; flex: none; }
  .steps { grid-template-columns: 1fr; }
  .doc-grid, .doc-grid.panel-closed:not(.rail-closed), .doc-grid:not(.rail-closed):not(.panel-closed) { --rail-w: 0px; --panel-w: 0px; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); position: relative; transition: none; }
  .rail { position: absolute; inset: 0 auto 0 0; width: min(85vw, 300px); z-index: 20; visibility: visible !important; transform: translateX(-100%); transition: transform 0.25s var(--ease); box-shadow: var(--shadow); }
  .doc-grid.rail-open .rail { transform: none; }
  .viewer { grid-column: 1; grid-row: 1; }
  .stage { padding: 12px 12px 112px; }
  /* two rows: navigation + export on top, tools below */
  .vtoolbar { padding: 6px 8px; gap: 6px; }
  .vt-group + .vt-group { padding-left: 0; border-left: 0; }
  .vt-group.nav { margin-left: 0; }
  .vt-group.zoom .btn-icon { display: none; }
  .vt-group.right { order: 4; }
  .vt-group.tools, .vt-group.preview-seg { order: 5; }
  .vt-group .btn-icon.small, .vtoolbar .zoom-level { width: var(--hit); height: var(--hit); border-radius: 10px; }
  .vtoolbar .zoom-level { width: auto; min-width: 48px; }
  .page-ind input { height: var(--hit); width: 44px; }
  #btn-export { width: var(--hit); height: var(--hit); }
  #btn-panel { display: none; }
  .doc-grid > .panel { position: absolute; left: 0; right: 0; bottom: 0; top: auto; height: 100px; z-index: 25; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 18px 18px 0 0; box-shadow: var(--shadow); visibility: visible !important; transition: height 0.3s var(--ease); overflow: hidden; }
  .doc-grid > .panel.open { height: min(80%, calc(100% - 48px)); }
  .panel-handle { display: block; width: 100%; height: 40px; border: 0; background: transparent; padding: 0; cursor: pointer; flex: none; }
  .panel-handle span { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line-3); margin: 0 auto; }
  .ptabs { margin: 0 10px 8px; }
  .ptabs button { min-height: var(--hit); }
  .ptab { padding-bottom: 24px; }
  .doc-grid > .panel:not(.open) .panel-body { visibility: hidden; }
  .rect-tools { bottom: 112px !important; top: auto !important; left: 50% !important; transform: translateX(-50%); }
  .rt-btn { width: var(--hit); height: var(--hit); }
  .f-row { height: 60px; }
  .f-list { flex: none; height: 58vh; min-height: 240px; } /* the sheet scrolls to a tall list instead of a 2-row slot */
  /* ≤ 300 rows (not virtualised): the list grows and the sheet is the ONE scroller — a nested scroller inside a
     scrolling sheet made swipes feel random ("sometimes it does not scroll") */
  .f-list:not(.is-virtual) { height: auto; min-height: 0; overflow: visible; }
  .f-check input { width: 22px; height: 22px; }
  .f-expand, .f-eye { width: var(--hit); height: var(--hit); }
  .f-controls .f-toggle, .f-controls .check svg { width: var(--hit); height: var(--hit); box-sizing: border-box; }
  .f-controls .check svg { padding: 11px; }
  .f-controls select { min-height: var(--hit); }
  .f-search input { min-height: var(--hit); }
  .chip-main, .chip-more, .chip-review { min-height: var(--hit); }
  .q-row { min-height: 52px; }
  .rail .btn-icon.small { width: var(--hit); height: var(--hit); }
  .thumb { max-width: 220px; align-self: center; }
  .rc-actions .btn, .rc-copy .btn, .rc-report button { min-height: var(--hit); }
  .shortcut-row { grid-template-columns: 104px 1fr; }
  .coach { max-width: calc(100vw - 24px); }
  .toasts { bottom: 116px; }
}
@media (hover: none) { .q-remove { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .doc-grid, .rail, .doc-grid > .panel, .coach-ring, .f-expand svg { transition: none !important; }
}
@media (forced-colors: active) {
  .rect.acc { forced-color-adjust: none; }
  .f-row.on { outline: 2px solid Highlight; }
}
