body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  margin: 0;
  padding: 0;
  color: #0f172a;
  background: #f8fafc;
}
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}
.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.app-logo {
  height: 28px;
  width: auto;
  display: block;
}
h1 {
  margin-top: 0;
}
section {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}
form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
input, button {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}
button {
  background: #0ea5e9;
  color: white;
  border: none;
  cursor: pointer;
}
button:hover {
  background: #0284c7;
}
.result {
  margin-top: 8px;
  color: #334155;
}
.viewer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.viewer-left, .viewer-right {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}
.viewer-right { background: #ffffff; }
.viewer-right .tabs { background: #ffffff; }
.viewer-right .tab-panels { background: #ffffff; }
.viewer-right .tab-panel { background: #ffffff; }
.parsed-pages { background: #ffffff; }
.pdf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}
.btn {
  padding: 6px 10px;
  border: 1px solid #0ea5e9;
  background: #e0f2fe; /* light blue */
  color: #0369a1;
  border-radius: 6px;
  cursor: pointer;
}
.btn.active {
  background: #0ea5e9;
  color: white;
  border-color: #0ea5e9;
}
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 12px;
}
.tab {
  padding: 6px 10px;
  border: 1px solid #0ea5e9;
  border-bottom: none;
  background: #e0f2fe;
  color: #0369a1;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  cursor: pointer;
}
.tab.active {
  background: #0ea5e9;
  color: #ffffff;
  font-weight: 600;
}
.tab-panels .tab-panel {
  display: none;
}
.tab-panels .tab-panel.active {
  display: block;
}
.page-index {
  display: none; /* hide page numbers per request */
}
.page-link {
  margin-right: 6px;
  text-decoration: none;
  color: #0369a1;
  font-size: 12px;
}
.page-link:hover {
  text-decoration: underline;
}
.parsed-pages section {
  margin: 12px 0;
  padding-bottom: 12px;
  border-bottom: 1px dashed #e2e8f0;
}
.seg-block {
  margin: 8px 0;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.seg-head {
  font-size: 12px;
  color: #475569;
  margin-bottom: 4px;
}
.seg-type {
  font-weight: 600;
}
.seg-conf {
  color: #64748b;
}
.seg-highlight {
  animation: segFlash 1.2s ease;
}
@keyframes segFlash {
  0% { box-shadow: 0 0 0 0 rgba(14,165,233,0.6); }
  50% { box-shadow: 0 0 0 6px rgba(14,165,233,0.0); }
  100% { box-shadow: 0 0 0 0 rgba(14,165,233,0.0); }
}
.seg-img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 6px 0;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}
.seg-caption {
  font-size: 12px;
  color: #475569;
  margin-top: 2px;
}

/* Markdown styles */
.md { line-height: 1.5; color: #0f172a; }
.md-p { margin: 8px 0; background: #ffffff; }
.md-spacer { margin: 6px 0; }
.md-h { margin: 10px 0 6px; }
.md-list { margin: 6px 0 6px 20px; }
.md-code { background: #0b1020; color: #e2e8f0; padding: 8px; border-radius: 6px; overflow: auto; }
.md-inline-code { background: #e2e8f0; color: #0f172a; padding: 1px 4px; border-radius: 4px; }
.md-quote { border-left: 3px solid #94a3b8; padding-left: 8px; color: #334155; margin: 6px 0; }
.md-hr { border: none; border-top: 1px solid #e2e8f0; margin: 8px 0; }
.md-table { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 6px; overflow: auto; }
.json {
  white-space: pre-wrap;
  background: #0b1020;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 6px;
  max-height: 70vh;
  overflow: auto;
}

.pdf-container {
  overflow-x: auto;
  height: calc(100vh - 180px);
}
.pdf-page {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  background: #ffffff;
}
.pdf-overlay {
  pointer-events: none;
}

.doc {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
  max-height: 30vh;
  overflow: auto;
  white-space: pre-wrap;
}


