/* ZapRedact editor.
   A quiet graphite workspace where the document is the brightest thing on
   screen. Lightning yellow is reserved for the one action that matters at
   each step. Detected values are set in a monospace face: they are data. */

@font-face {
  font-family: "Plex";
  src: url("../assets/fonts/IBMPlexSans.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}
@font-face {
  font-family: "Mono";
  src: url("../assets/fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #1b1d21;          /* chrome */
  --bg-2: #222529;        /* sidebar */
  --raised: #2a2d33;      /* rows, inputs */
  --stage: #33363c;       /* behind the paper */
  --line: #383c43;
  --fg: #eeede9;
  --muted: #a4a7ae;
  --faint: #767a82;
  --accent: #fcd00e;      /* brand bolt: primary action only */
  --accent-2: #ffe04a;
  --review: #f5a524;      /* needs a human look */
  --ok: #46a758;
  --danger: #e5484d;
  --card: var(--raised);
  --border: var(--line);
  --warn: var(--review);
  --radius: 8px;
  --mono: "Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Plex", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body { display: flex; flex-direction: column; overflow: hidden; }
button, input { font-family: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible, label:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- Top bar ---------- */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 8px 16px 8px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 8px; }
.bolt { color: var(--accent); font-size: 20px; line-height: 1; }
.brand { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.doc-title {
  min-width: 0;
  max-width: 40vw;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-title strong { color: var(--fg); font-weight: 500; }
.local-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}
.local-badge svg { width: 14px; height: 14px; color: var(--ok); flex: none; }

.account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  font-size: 12.5px;
}
.account__info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account__email { color: var(--fg); overflow-wrap: anywhere; }
.account__plan {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.account__plan.is-pro { border-color: rgba(252, 208, 14, .45); color: var(--accent); }
.account__usage { color: var(--faint); font-size: 12px; }
.account__btn {
  background: var(--accent);
  color: #1b1d21;
  border: 1px solid var(--accent);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.account__btn:hover { background: var(--accent-2); }
.account__btn.is-manage, .account__btn--logout {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
  font-weight: 500;
}
.account__btn.is-manage:hover, .account__btn--logout:hover { color: var(--fg); border-color: var(--faint); }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}
.sidebar__scroll { flex: 1; min-height: 0; overflow-y: auto; }
.panel { padding: 18px 20px; border-bottom: 1px solid var(--line); }

/* Document */
#file-picker-wrap { position: relative; }
#file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
#file-input:focus-visible + .file-btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-btn {
  display: block;
  text-align: center;
  padding: 10px 12px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--fg);
  font-weight: 500;
  cursor: pointer;
}
.file-btn:hover { border-color: var(--faint); }
body.is-empty .file-btn { background: var(--accent); border-color: var(--accent); color: #1b1d21; font-weight: 600; }
body.is-empty .file-btn:hover { background: var(--accent-2); }
.doc-info { margin-top: 8px; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.doc-info:empty { display: none; }

/* Review list */
.review-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.review-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.review-summary { color: var(--muted); font-size: 12.5px; text-align: right; }
.review-summary .is-review { color: var(--review); }
.detection-list { display: flex; flex-direction: column; gap: 2px; }
.detection-empty { color: var(--faint); font-size: 13px; padding: 4px 0 8px; }
.detection-group { margin-top: 10px; }
.detection-group:first-child { margin-top: 0; }
.detection-group__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  color: var(--muted);
  font-size: 12.5px;
}
.detection-group__head .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.detection-group__head .count { margin-left: auto; color: var(--faint); font-variant-numeric: tabular-nums; }
.detection-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.detection-row:hover { background: var(--raised); }
.detection-row input[type=checkbox] { margin: 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; cursor: pointer; }
.detection-row .dot { display: none; }
.detection-row .txt {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detection-row.is-off .txt { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--faint); }
.detection-row.is-review .txt { color: var(--review); }
.detection-row .pg { color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; flex: none; }
.detection-row .handwriting-review-note { display: block; white-space: normal; color: var(--review); font-family: "Plex", sans-serif; font-size: 11.5px; line-height: 1.4; margin-top: 3px; }
.detection-row .handwriting-confirm { flex-shrink: 0; max-width: 112px; white-space: normal; font-size: 11.5px; padding: 5px 8px; border: 1px solid rgba(245, 165, 36, .55); border-radius: 6px; color: var(--review); background: rgba(245, 165, 36, .08); cursor: pointer; }
.detection-row .handwriting-confirm:disabled { opacity: .45; cursor: default; }

.bulk-actions { display: flex; gap: 8px; margin-top: 12px; }
.bulk-actions button {
  flex: 1;
  min-height: 32px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
}
.bulk-actions button:hover { color: var(--fg); border-color: var(--faint); }
.draw-toggle { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 13.5px; cursor: pointer; }
.draw-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.tip { margin: 6px 0 0; font-size: 12px; color: var(--faint); line-height: 1.55; }
.tip:empty { display: none; }
.tip kbd {
  display: inline-block;
  padding: 0 4px;
  font: 500 10.5px/1.5 var(--mono);
  color: var(--muted);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 3px;
}

/* Settings */
.panel--settings summary {
  list-style: none;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel--settings summary::-webkit-details-marker { display: none; }
.panel--settings summary::before {
  content: "";
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s;
}
.panel--settings[open] summary::before { transform: rotate(45deg); }
.panel--settings summary:hover { color: var(--fg); }
.category-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; margin-top: 12px; }
.cat-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.cat-toggle:hover { background: var(--raised); }
.cat-toggle input[type=checkbox] { width: 15px; height: 15px; margin: 0; accent-color: var(--cat-color, var(--accent)); cursor: pointer; }

/* Export, pinned to the bottom of the sidebar */
.export-bar {
  flex: none;
  padding: 16px 20px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
button.primary {
  width: 100%;
  min-height: 44px;
  background: var(--accent);
  color: #1b1d21;
  border: none;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
}
button.primary:disabled { background: var(--raised); color: var(--faint); cursor: not-allowed; }
button.primary:not(:disabled):hover { background: var(--accent-2); }
.export-note { margin: 10px 0 0; font-size: 12px; color: var(--faint); line-height: 1.5; }
.verify-banner {
  margin: 0 0 10px;
  padding: 9px 11px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  border: 1px solid;
}
.verify-banner--pass { background: rgba(70, 167, 88, .12); border-color: rgba(70, 167, 88, .5); color: #9be0a8; }
.verify-banner--warn { background: rgba(245, 165, 36, .1); border-color: rgba(245, 165, 36, .5); color: #f8c875; }
.verify-banner--fail { background: rgba(229, 72, 77, .12); border-color: rgba(229, 72, 77, .6); color: #ffa1a4; font-weight: 600; }

/* ---------- Viewer ---------- */
.viewer {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--stage);
}
.viewer-toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: rgba(34, 37, 41, .94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.progress { flex: 1; min-width: 0; }
.progress-text { font-size: 13px; color: var(--muted); line-height: 1.45; }
.progress .bar { height: 2px; margin-top: 6px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress .fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.view-controls { display: flex; align-items: center; gap: 12px; flex: none; }
.segmented { display: inline-flex; padding: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; }
.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 5px;
  font-size: 12.5px;
  cursor: pointer;
}
.segmented button:hover { color: var(--fg); }
.segmented button.is-on { background: var(--raised); color: var(--fg); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }
.zoom-controls { display: flex; align-items: center; gap: 4px; }
.zoom-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}
.zoom-btn:hover { color: var(--fg); border-color: var(--line); }
.zoom-btn.zoom-reset { font-size: 12.5px; }
#zoom-level { min-width: 3.2em; text-align: center; font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); }

/* Empty state: the whole stage is the drop target */
.empty {
  margin: 28px;
  min-height: calc(100% - 56px - 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 48px 24px;
  border: 1.5px dashed #4a4e56;
  border-radius: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.empty:hover { border-color: var(--faint); background: rgba(255,255,255,.015); }
.empty.hidden { display: none; }
.empty__sheet {
  width: 104px; height: 132px;
  margin-bottom: 14px;
  padding: 22px 16px;
  background: #fbfbf9;
  border-radius: 3px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  display: flex; flex-direction: column; gap: 9px;
}
.empty__sheet span { display: block; height: 6px; background: #d9d9d4; border-radius: 1px; }
.empty__sheet .is-bar { background: #111; height: 9px; width: 78%; }
.empty__sheet .is-short { width: 52%; }
.empty__title { color: var(--fg); font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.empty__text { max-width: 380px; line-height: 1.55; }
.empty__privacy {
  display: inline-flex; align-items: flex-start; gap: 8px;
  max-width: 400px; margin-top: 12px;
  color: var(--faint); font-size: 12.5px; text-align: left;
}
.empty__privacy svg { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--ok); }
.drop-veil {
  position: absolute; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(27, 29, 33, .78);
  border: 2px dashed var(--accent);
  color: var(--fg); font-size: 18px; font-weight: 600;
  pointer-events: none;
}

/* Pages */
.pages { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px; }
.page-label { align-self: stretch; max-width: 900px; margin: 12px auto 0; color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.page-label:first-child { margin-top: 0; }
.page-mode { font-size: 11.5px; padding: 1px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--faint); }
.page-mode--review { border-color: rgba(245, 165, 36, .55); color: var(--review); }
.reading-guide-note { color: var(--faint); font-size: 12px; }
.page-wrap { position: relative; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25), 0 16px 40px rgba(0,0,0,.28); }
.page-wrap canvas.page-canvas { display: block; max-width: 100%; height: auto; }
.page-wrap .overlay { position: absolute; inset: 0; pointer-events: auto; }
.page-wrap.drawing .overlay { cursor: crosshair; touch-action: none; }
.page-ocr-failed { outline: 2px dashed var(--review); outline-offset: 2px; }
.page-ocr-failed-badge { position: absolute; top: 6px; right: 6px; background: #fff3cd; color: #5c4b00; font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 4px; border: 1px solid #d97706; pointer-events: none; z-index: 20; }

/* Detection boxes */
.page-wrap .box {
  position: absolute;
  pointer-events: auto;
  border: 2px solid currentColor;
  background: currentColor;
  opacity: 0.35;
  border-radius: 2px;
  mix-blend-mode: multiply;
  cursor: pointer;
}
.page-wrap .box.rejected { opacity: 0.15; border-style: dashed; }
.page-wrap .box.selected { outline: 2px solid var(--danger); outline-offset: 1px; }
.page-wrap .box.precise-mask { background: transparent; }
.page-wrap .box.precise-mask > svg { position: absolute; inset: -2px; width: calc(100% + 4px); height: calc(100% + 4px); pointer-events: none; fill: currentColor; }

/* Preview redacted: what the exported file will look like. Selected areas
   become solid bars; cleared ones and review guides disappear. */
.pages.is-preview .box:not(.rejected) {
  color: #000 !important;
  background: #000;
  border-color: #000;
  opacity: 1;
  mix-blend-mode: normal;
  animation: zr-bar-in .22s ease-out both;
}
.pages.is-preview .box.precise-mask:not(.rejected) { background: transparent; border-color: transparent; }
.pages.is-preview .box.rejected, .pages.is-preview .reading-guide { visibility: hidden; }
.pages.is-preview .box .rh { display: none; }
@keyframes zr-bar-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Resize handles: invisible and unclickable until the box is selected, so a
   click on a thin box selects it instead of starting a resize. */
.page-wrap .box .rh {
  position: absolute;
  width: 9px; height: 9px;
  background: #fff;
  border: 1.5px solid #1f2937;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: normal;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: opacity 0.08s, background 0.1s, border-color 0.1s;
}
.page-wrap .box.selected .rh, .page-wrap .box.resizing .rh { opacity: 1; pointer-events: auto; }
.page-wrap .box .rh:hover { background: var(--danger); border-color: #c73a3f; }
.page-wrap .box .rh-nw { top: -5px; left: -5px; cursor: nwse-resize; }
.page-wrap .box .rh-ne { top: -5px; right: -5px; cursor: nesw-resize; }
.page-wrap .box .rh-sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.page-wrap .box .rh-se { bottom: -5px; right: -5px; cursor: nwse-resize; }
.page-wrap .box .rh-n  { top: -5px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.page-wrap .box .rh-s  { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.page-wrap .box .rh-w  { top: 50%; left: -5px; transform: translateY(-50%); cursor: ew-resize; }
.page-wrap .box .rh-e  { top: 50%; right: -5px; transform: translateY(-50%); cursor: ew-resize; }
.page-wrap .box.rejected .rh { opacity: 0; pointer-events: none; }
/* Floating delete: a sibling of .box so the box's tint does not wash it out. */
.overlay .floating-delete {
  position: absolute;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--danger);
  color: #fff;
  padding: 0;
  cursor: pointer;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.22);
  mix-blend-mode: normal;
  isolation: isolate;
  transition: transform 0.12s ease, background 0.12s ease;
}
.overlay .floating-delete svg { width: 11px; height: 11px; display: block; pointer-events: none; }
.overlay .floating-delete:hover { background: #c73a3f; transform: scale(1.08); }
.overlay .floating-delete:active { transform: scale(0.96); }
.reading-guide { position: absolute; box-sizing: border-box; border: 2px dashed #b86e00; outline: 1px solid rgba(255, 255, 255, .8); pointer-events: none; }

/* ---------- Modals (sign-in, upgrade) ---------- */
.zr-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
  background: rgba(15, 16, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: zr-modal-fade 160ms ease-out;
}
@keyframes zr-modal-fade { from { opacity: 0; } to { opacity: 1; } }
.zr-modal__card {
  margin: auto;
  width: 100%; max-width: 420px;
  padding: 28px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.zr-modal__bolt { font-size: 28px; color: var(--accent); margin-bottom: 8px; }
.zr-modal__title { margin: 0 0 6px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.zr-modal__subtitle { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.zr-modal__field { margin: 0 0 12px; }
.zr-modal__field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.zr-modal__field input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--fg);
  font-size: 15px;
}
#zr-login-code { font-family: var(--mono); font-size: 22px; letter-spacing: .35em; }
.zr-modal__field input:focus { outline: none; border-color: var(--accent); }
.zr-modal__error { color: #ff8a8e; font-size: 12.5px; margin: 0 0 10px; min-height: 16px; }
.zr-modal__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.zr-modal__btn { padding: 11px 18px; border-radius: var(--radius); font-size: 14.5px; font-weight: 600; cursor: pointer; border: none; }
.zr-modal__btn--primary { background: var(--accent); color: #1b1d21; }
.zr-modal__btn--primary:hover { background: var(--accent-2); }
.zr-modal__btn--primary:disabled { opacity: 0.6; cursor: progress; }
.zr-modal__btn--ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.zr-modal__btn--ghost:hover { color: var(--fg); }
.zr-modal__plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.zr-modal__plan {
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 14px 12px;
  text-align: left;
  cursor: pointer;
  color: var(--fg);
  transition: border-color 0.12s;
}
.zr-modal__plan:hover { border-color: var(--faint); }
.zr-modal__plan.is-selected { border-color: var(--accent); background: rgba(252, 208, 14, 0.05); }
.zr-modal__plan-label { font-size: 12.5px; color: var(--muted); }
.zr-modal__plan-price { font-size: 20px; font-weight: 600; margin-top: 4px; }
.zr-modal__plan-effective { font-size: 12px; color: #7fd18d; margin-top: 2px; }
.zr-modal__plan-save { display: inline-block; margin-left: 6px; padding: 1px 6px; background: rgba(70, 167, 88, 0.18); color: #7fd18d; border-radius: 4px; font-size: 11px; font-weight: 500; }
.zr-modal__fineprint { color: var(--faint); font-size: 12px; margin-top: 14px; line-height: 1.5; }
.zr-modal__fineprint a { color: var(--muted); }

/* ---------- Busy and small screens ---------- */
button:disabled, input:disabled + .file-btn { opacity: .55; cursor: wait; }
button.primary:disabled { opacity: 1; }
@media (max-width: 1100px) {
  .local-badge span { display: none; }
  .doc-title { max-width: 26vw; }
  .view-controls { gap: 6px; }
}
@media (max-width: 860px) {
  .viewer-toolbar { flex-wrap: wrap; }
  .progress { flex-basis: 100%; }
  .account__usage { display: none; }
}
@media (max-width: 760px) {
  body { overflow: auto; }
  .topbar { flex-wrap: wrap; }
  .doc-title { display: none; }
  .layout { display: flex; flex-direction: column; flex: none; }
  .sidebar { border-right: 0; }
  .sidebar__scroll { overflow: visible; }
  .viewer { min-height: 70vh; }
  .empty { margin: 16px; min-height: 60vh; }
  .pages { padding: 16px; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.progress .bar.is-done { visibility: hidden; }
.detection-group--unread .group-action {
  margin-left: auto;
  padding: 2px 8px;
  background: transparent;
  color: var(--review);
  border: 1px solid rgba(245, 165, 36, .5);
  border-radius: 5px;
  font-size: 11.5px;
  cursor: pointer;
}
.detection-group--unread .group-action:hover { background: rgba(245, 165, 36, .1); }
.detection-group--unread .group-action + .count { margin-left: 8px; }
.group-note { margin: 0 0 4px; padding: 0 2px; color: var(--faint); font-size: 12px; line-height: 1.45; }
.detection-row.is-unread .txt { font-family: "Plex", sans-serif; font-style: italic; }
