:root {
  --bg: #f3f5f8; --panel: #fff; --line: #dde2ea; --text: #1f2633; --muted: #6b7482;
  --accent: #0078d7; --accent-h: #006cc1; --head: #1c2630; --sel: #dbe6fd; --ok: #1f8a4c; --bad: #c0392b;
  --r: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.grow { flex: 1; }

.top { background: var(--head); color: #fff; padding: 18px 28px; display: flex; align-items: center;
  gap: 24px; flex-wrap: wrap; }
.back { color: #8fc3ff; text-decoration: none; font-size: 14px; align-self: flex-start; margin-top: 4px; }
.back:hover { text-decoration: underline; }
.brand { display: flex; gap: 14px; align-items: center; flex: 1; min-width: 300px; }
.logo { width: 40px; height: 40px; flex: none; }
.top h1 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: .1px; }
.top p { margin: 2px 0 0; color: #a9b4ca; font-size: 14px; }
.privacy { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #d7def0;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); padding: 7px 12px; border-radius: 99px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px rgba(61,220,132,.2); }

main { padding: 20px 28px 8px; }
.start { max-width: 980px; margin: 10px auto 0; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 42px 20px;
  background: var(--panel); border: 2px dashed #b9c6e0; border-radius: 16px; cursor: pointer;
  transition: border-color .15s, background .15s; text-align: center; }
.drop:hover, .drop.over { border-color: var(--accent); background: #f7f9ff; }
.drop input { display: none; }
.drop-ico svg { width: 56px; height: 56px; }
.drop b { font-size: 18px; }
.drop span { color: var(--muted); }
.facts { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.facts li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px;
  font-size: 13.5px; color: #3a4252; }
.facts b { display: block; color: var(--text); font-size: 14.5px; margin-bottom: 4px; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr; } }
.boot { margin: 18px auto 0; max-width: 520px; text-align: center; color: var(--muted); font-size: 14px; }
.bar { height: 6px; background: var(--line); border-radius: 9px; overflow: hidden; margin-bottom: 8px; }
.bar i { display: block; height: 100%; width: 30%; background: var(--accent); border-radius: 9px;
  animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }

.btn { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: #f0f3f8; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-h); }
.btn.tool { padding: 4px 10px; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; user-select: none; margin-right: 6px; }
.switch input { display: none; }
.switch span { width: 34px; height: 20px; border-radius: 99px; background: #c9d1df; position: relative; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { left: 16px; }

.cols { display: grid; grid-template-columns: 240px minmax(0, 1fr) 300px; gap: 12px; height: calc(100vh - 240px); min-height: 520px; }
@media (max-width: 1000px) { .cols { grid-template-columns: 1fr; height: auto; } .view { height: 70vh; } .found-list { max-height: 50vh; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ph { padding: 10px 14px; font-weight: 600; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.files ul { list-style: none; margin: 0; padding: 6px; overflow: auto; flex: 1; }
.files li { padding: 8px 10px; border-radius: 7px; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
.files li:hover { background: #f3f6fb; }
.files li.on { background: var(--sel); }
.files .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.files .fc { font-size: 12px; color: var(--muted); }
.files .x { grid-column: 1 / -1; font-size: 12px; color: var(--bad); }
.hint { padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.vh { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.doc-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }
.zoom { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.warn { background: #fff6e6; color: #8a4408; border-bottom: 1px solid #f3dfb7; padding: 8px 12px; font-size: 13px; }
.view { flex: 1; overflow: auto; background: #e6e9ef; padding: 16px; }
.page { position: relative; margin: 0 auto 16px; background: #fff; box-shadow: 0 1px 3px rgba(15,26,51,.18); user-select: none; }
.page img { position: absolute; inset: 0; width: 100%; height: 100%; }
.page .no { position: absolute; right: 8px; bottom: -14px; font-size: 11px; color: var(--muted); }
.ov { position: absolute; inset: 0; cursor: crosshair; }
.hit { position: absolute; border-radius: 2px; cursor: pointer; mix-blend-mode: multiply; }
.hit.off { background: transparent !important; outline: 1.5px dashed currentColor; mix-blend-mode: normal; }
.res .hit:not(.off), .res .man, .res .img.on { background: #000 !important; mix-blend-mode: normal; outline: none; }
.man { position: absolute; background: rgba(15,26,51,.55); outline: 2px solid #0f1a33; cursor: pointer; }
.img { position: absolute; outline: 2px dashed #8a93a5; cursor: pointer; }
.img.on { outline-color: #0f1a33; background: rgba(15,26,51,.45); }
.rubber { position: absolute; border: 2px dashed var(--accent); background: rgba(37,99,235,.08); pointer-events: none; }
.textdoc { background: #fff; max-width: 900px; margin: 0 auto; padding: 22px 26px; white-space: pre-wrap; font-size: 14.5px;
  box-shadow: 0 1px 3px rgba(15,26,51,.18); border-radius: 4px; }
.textdoc mark { border-radius: 3px; padding: 0 1px; cursor: pointer; }
.textdoc mark.off { background: transparent !important; text-decoration: line-through; color: var(--muted) !important; }
.res .textdoc mark:not(.off) { background: #000 !important; color: #000 !important; }
.found-list { overflow: auto; flex: 1; padding: 6px 4px 10px; }
.cat { margin: 4px 6px 8px; }
.cat-h { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; padding: 4px 6px; cursor: pointer; }
.cat-h .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.val { display: flex; gap: 8px; align-items: flex-start; padding: 4px 6px 4px 24px; border-radius: 6px; font-size: 13.5px; cursor: pointer; }
.val:hover { background: #f3f6fb; }
.val.off { color: #9aa0aa; text-decoration: line-through; }
.val .n { color: var(--muted); font-size: 12px; margin-left: auto; }
.val input, .cat-h input { margin-top: 3px; accent-color: var(--accent); }
.status { margin-top: 8px; font-size: 13px; color: var(--muted); }

dialog { border: none; border-radius: 14px; padding: 0; max-width: 640px; width: calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(15,26,51,.35); color: var(--text); }
dialog::backdrop { background: rgba(15,26,51,.45); }
dialog form { padding: 20px 22px; }
dialog h2 { margin: 0 0 12px; font-size: 19px; }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin-bottom: 14px; font-size: 14px; }
.cats label { display: flex; gap: 8px; align-items: center; }
.lbl { font-size: 13.5px; color: var(--muted); display: block; margin-bottom: 6px; }
textarea { width: 100%; font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; resize: vertical; }
textarea:focus { outline: 2px solid var(--sel); border-color: var(--accent); }
.dlg-bar { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.done-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.done-row .nm { font-weight: 600; overflow-wrap: anywhere; }
.done-row .st { grid-column: 1; font-size: 13px; color: var(--muted); }
.done-row .ok { color: var(--ok); font-size: 13px; grid-column: 1 / -1; }
.done-row .bad { color: var(--bad); font-size: 13px; grid-column: 1 / -1; }
.done-row a.btn { grid-row: 1 / span 2; grid-column: 2; text-decoration: none; }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 14px 20px 22px; }
.foot a { color: var(--muted); }
