/* OCR PDF page. Shared PDF CSS stays; this file only restyles this page. */
.opdf-page {
  --op-ink: #172033;
  --op-body: #3d4658;
  --op-muted: #64748b;
  --op-line: #e3e9f1;
  --op-blue: #2563eb;
  --op-aside-w: 230px;
  display: grid;
  grid-template-columns: var(--op-aside-w) minmax(0, 1fr);
  gap: 18px 22px;
  align-items: start;
  margin: 4px 0 28px;
}
.opdf-aside { display: flex; flex-direction: column; min-width: 0; padding-top: 8px; }
.opdf-title {
  margin: 0 0 8px;
  color: var(--op-ink);
  font-size: clamp(1.8rem, 3vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  text-align: left;
}
.article .opdf-lede {
  margin: 0 0 16px;
  color: #3b4d9a;
  font-size: 1.02rem;
  line-height: 1.4;
  text-align: left;
}
.article img.opdf-art {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 16px 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}
.article .opdf-perks { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.article .opdf-perks li { display: flex; align-items: center; gap: 10px; margin: 0; padding: 0; color: var(--op-body); font-size: 0.8rem; line-height: 1.3; text-align: left; }
.article .opdf-perks li::before { content: none; }
.opdf-perks strong { display: block; color: var(--op-ink); font-size: 0.88rem; }
.opdf-perk { width: 36px; height: 36px; flex: none; border-radius: 50%; background: #fff center / 18px no-repeat; }
.opdf-perk.is-online { background-color: #dcfce7; background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%2316a34a'/%3E%3Cpath d='m7 12.2 3.2 3.2L17 9' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.opdf-perk.is-fast { background-color: #ffe4e6; background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23e11d48' d='M13.5 2 4.5 13.5h6.2L9.8 22l9-11.5h-6.2z'/%3E%3C/svg%3E"); }
.opdf-perk.is-lang { background-color: #dbeafe; background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.5 2.8 2.5 15.2 0 18M12 3c-2.5 2.8-2.5 15.2 0 18'/%3E%3C/svg%3E"); }
.opdf-perk.is-scan { background-color: #ede9fe; background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2'%3E%3Crect x='4' y='5' width='16' height='14' rx='2'/%3E%3Cpath d='m8 15 2.2-2.8 1.8 2.2 2-2.6L16 15'/%3E%3C/svg%3E"); }

body.page-ocr-pdf-online .cpdf-app {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.page-ocr-pdf-online #opdf-app [hidden] { display: none !important; }
body.page-ocr-pdf-online #opdf-app > .cpdf-success {
  margin: 0 0 12px;
  border: 1px solid #bbf7d0;
  border-radius: 16px;
}
body.page-ocr-pdf-online .cpdf-side {
  width: auto;
  max-width: none;
  margin-top: 14px;
  padding: 0;
  background: transparent;
}
body.page-ocr-pdf-online .cpdf-side .itool-hist-list {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
}

.opdf-board {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(320px, 0.95fr);
  gap: 12px;
  align-items: start;
}
.opdf-stack { display: grid; gap: 12px; min-width: 0; }
.opdf-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--op-line);
  border-radius: 16px;
  background: #fff;
}
.opdf-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 12px;
  list-style: none;
  border: 1px solid var(--op-line);
  border-radius: 16px;
  background: #fff;
}
.opdf-steps li { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; color: var(--op-muted); }
.opdf-steps li > span:first-child {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
}
.opdf-steps strong, .opdf-steps small { display: block; }
.opdf-steps strong { color: var(--op-ink); font-size: 0.78rem; line-height: 1.2; }
.opdf-steps small { color: var(--op-muted); font-size: 0.68rem; line-height: 1.2; }
.opdf-steps .is-done > span:first-child { background: #16a34a; color: #fff; }
.opdf-steps .is-on > span:first-child { background: var(--op-blue); color: #fff; }
.opdf-steps .is-on strong { color: var(--op-blue); }
.opdf-steps strong,
.opdf-steps small { white-space: nowrap; }

.article h2.opdf-card-title,
.opdf-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--op-ink);
  font-size: 1.02rem;
  font-weight: 800;
  text-align: left;
}
.opdf-ico-bubble {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: #dbeafe center / 16px no-repeat;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2'%3E%3Cpath d='M12 16V8M8 12l4-4 4 4'/%3E%3Cpath d='M6 19h12'/%3E%3C/svg%3E");
}
.opdf-ico-bubble.is-gear { background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6l1.4 1.4M17 17l1.4 1.4M18.4 5.6 17 7M7 17l-1.4 1.4'/%3E%3C/svg%3E"); }
.opdf-ico-bubble.is-eye { background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2'%3E%3Cpath d='M2 12s4-6 10-6 10 6 10 6-4 6-10 6S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3C/svg%3E"); }
.opdf-ico-bubble.is-doc { background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2'%3E%3Cpath d='M7 3h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z'/%3E%3Cpath d='M14 3v5h5M8 13h8M8 17h6'/%3E%3C/svg%3E"); }
.article .opdf-sub,
.article .opdf-note,
.article .opdf-status,
.article .opdf-meta,
.article .opdf-stats {
  margin: 4px 0 12px;
  color: var(--op-muted);
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: left;
}
.article .opdf-note { margin: 10px 0 0; }
.article .opdf-note a { color: var(--op-blue); }
.article .opdf-status { min-height: 1.1em; margin: 8px 0; }
.article .opdf-status.is-error { color: #b91c1c; }
.article .opdf-status.is-ok { color: #15803d; }
.article .opdf-status.is-loading { color: var(--op-blue); }
.article .opdf-meta,
.article .opdf-stats { margin: 8px 0 0; word-break: break-word; }

.opdf-ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.page-ocr-pdf-online .cpdf-app .cpdf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; }
body.page-ocr-pdf-online .opdf-drop {
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 22px 14px;
  border: 1.5px dashed #93c5fd;
  border-radius: 14px;
  background: #f5f9ff;
  box-shadow: none;
  text-align: center;
}
.opdf-cloud {
  width: 54px;
  height: 54px;
  margin: 0 auto 4px;
  border-radius: 50%;
  background: #fff url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%232563eb' d='M7 18h10a4 4 0 0 0 .4-8 5 5 0 0 0-9.7-1.2A3.5 3.5 0 0 0 7 18z'/%3E%3Cpath fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' d='M12 16V9m0 0-2.2 2.2M12 9l2.2 2.2'/%3E%3C/svg%3E") center / 34px no-repeat;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}
body.page-ocr-pdf-online .opdf-drop .cpdf-drop-title { color: var(--op-ink); font-size: 1rem; font-weight: 800; }
body.page-ocr-pdf-online .opdf-drop .cpdf-drop-hint { max-width: none; color: var(--op-muted); }

.opdf-chip {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--op-line);
  border-radius: 12px;
  background: #fff;
}
.opdf-badge { display: grid; place-items: center; width: 36px; height: 42px; border-radius: 8px; background: #fee2e2; color: #dc2626; font-size: 0.62rem; font-weight: 800; }
.opdf-chip strong, .opdf-chip small { display: block; }
.opdf-chip strong { overflow: hidden; color: var(--op-ink); font-size: 0.84rem; text-overflow: ellipsis; white-space: nowrap; }
.opdf-chip small { color: var(--op-muted); font-size: 0.75rem; }
.opdf-x { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: #64748b; font-size: 1.2rem; cursor: pointer; }

.opdf-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.opdf-split { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 14px; }
fieldset.opdf-field { border: 0; min-width: 0; }
.article .opdf-steps,
.article .opdf-steps li { list-style: none; }
.article .opdf-steps li::before { content: none; }
.opdf-field, .opdf-field legend {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  color: var(--op-body);
  font-size: 0.82rem;
  font-weight: 700;
}
.opdf-field small { display: block; margin-top: 6px; color: var(--op-muted); font-size: 0.75rem; font-weight: 500; }
body.page-ocr-pdf-online #opdf-app select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--op-line);
  border-radius: 10px;
  background: #fff;
  color: var(--op-ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
}
.opdf-modes { display: grid; gap: 8px; }
.opdf-modes label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--op-line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.opdf-modes label.is-on { border-color: #93c5fd; background: #f5f9ff; }
.opdf-modes strong, .opdf-modes small { display: block; }
.opdf-modes strong { color: var(--op-ink); font-size: 0.84rem; }
.opdf-modes small { color: var(--op-muted); font-size: 0.74rem; font-weight: 500; line-height: 1.3; }
body.page-ocr-pdf-online .opdf-modes input[type="radio"] {
  width: 16px;
  height: 16px;
  flex: none;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--op-blue);
}
.opdf-bar { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.opdf-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #1d4ed8, #60a5fa); transition: width 0.15s ease; }
.article #opdf-progress-text { margin: 6px 0 0; color: var(--op-muted); font-size: 0.78rem; text-align: left; }
.opdf-go {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--op-blue);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}
.opdf-go:disabled { opacity: 0.55; cursor: not-allowed; }

.opdf-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.opdf-pager { display: flex; align-items: center; gap: 6px; color: var(--op-body); font-size: 0.82rem; font-weight: 700; }
.opdf-pager button, .opdf-zoom select {
  min-width: 32px;
  height: 32px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid var(--op-line);
  border-radius: 8px;
  background: #fff;
  color: var(--op-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.opdf-zoom { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--op-muted); font-size: 0.75rem; font-weight: 700; }
body.page-ocr-pdf-online #opdf-app .opdf-zoom select { width: auto; margin: 0; padding: 0 8px; font-size: 0.8rem; }
.opdf-view { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 10px; align-items: start; }
.opdf-stage {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 280px;
  max-height: 560px;
  overflow: auto;
  padding: 12px;
  border-radius: 14px;
  background: #eef3fb;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 transparent;
}
.article .opdf-stage p { margin: auto; color: var(--op-muted); font-size: 0.88rem; text-align: center; }
#opdf-preview { display: block; height: auto; background: #fff; box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08); }
.opdf-thumbs {
  max-height: 520px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 transparent;
}
.opdf-thumbs::-webkit-scrollbar,
.opdf-stage::-webkit-scrollbar { width: 4px; height: 4px; }
.opdf-thumbs::-webkit-scrollbar-button,
.opdf-stage::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.opdf-thumbs::-webkit-scrollbar-thumb,
.opdf-stage::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 99px; }
.opdf-thumb {
  display: grid;
  gap: 4px;
  width: 100%;
  margin: 0 0 8px;
  padding: 6px;
  border: 1px solid var(--op-line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.opdf-thumb.is-on { border-color: var(--op-blue); box-shadow: 0 0 0 2px #bfdbfe; }
.opdf-thumb canvas { display: block; width: 100%; height: auto; }
.opdf-thumb span { color: var(--op-muted); font-size: 0.72rem; font-weight: 700; text-align: center; }
.article .opdf-thumb-more { margin: 0; color: var(--op-muted); font-size: 0.72rem; text-align: center; }

#opdf-out {
  width: 100%;
  min-height: 180px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--op-line);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--op-ink);
  font: 500 0.84rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  resize: vertical;
}
.opdf-downloads { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.opdf-downloads .cpdf-btn { flex: 1 1 160px; }

@media (min-width: 1360px) {
  .opdf-page {
    --op-stage-w: min(1600px, calc(100vw - 96px));
    --op-aside-w: clamp(230px, 16vw, 280px);
    width: var(--op-stage-w);
    margin-left: calc((100% - var(--op-stage-w)) / 2);
    column-gap: 26px;
  }
}
@media (max-width: 1100px) {
  .opdf-board { grid-template-columns: 1fr; }
  .opdf-page { --op-aside-w: 200px; }
  .opdf-split { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .opdf-page { grid-template-columns: minmax(0, 1fr); }
  .article .opdf-perks,
  .article img.opdf-art { display: none; }
}
@media (max-width: 720px) {
  .opdf-steps { grid-template-columns: 1fr 1fr; }
  .opdf-view { grid-template-columns: minmax(0, 1fr) 88px; }
  .opdf-go { font-size: 0.92rem; }
}

html[data-theme="dark"] .opdf-page { --op-ink: #f1f5f9; --op-body: #cbd5e1; --op-muted: #94a3b8; --op-line: #334155; }
html[data-theme="dark"] .article .opdf-lede { color: #a5b4fc; }
html[data-theme="dark"] .opdf-card,
html[data-theme="dark"] .opdf-steps,
html[data-theme="dark"] .opdf-chip,
html[data-theme="dark"] .opdf-modes label,
html[data-theme="dark"] .opdf-thumb,
html[data-theme="dark"] body.page-ocr-pdf-online #opdf-app select,
html[data-theme="dark"] #opdf-out { background: #1e293b; border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] body.page-ocr-pdf-online .opdf-drop,
html[data-theme="dark"] .opdf-stage { background: #0f1b33; }
html[data-theme="dark"] .opdf-modes label.is-on,
html[data-theme="dark"] .opdf-thumb.is-on { background: #0f1b33; }
html[data-theme="dark"] .opdf-go { color: #fff; }
