* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: Arial, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border-bottom: 1px solid #d7d7d7;
  background: #f5f5f5;
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
}

.title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.build-info {
  font-size: 11px;
  color: #666;
}

.current-chapter {
  display: inline-block;
  font-weight: 700;
  color: #2c2c2c;
}

.current-chapter.is-pulsing {
  animation: chapterPulse 760ms ease-out 2;
  transform-origin: center;
}

@keyframes chapterPulse {
  0% {
    color: #2c2c2c;
    text-shadow: 0 0 0 rgba(38, 120, 210, 0);
    transform: scale(1);
  }
  35% {
    color: #0f4ea3;
    text-shadow: 0 0 14px rgba(38, 120, 210, 0.7);
    transform: scale(2);
  }
  65% {
    color: #0f4ea3;
    text-shadow: 0 0 10px rgba(38, 120, 210, 0.55);
    transform: scale(1.3);
  }
  100% {
    color: #2c2c2c;
    text-shadow: 0 0 0 rgba(38, 120, 210, 0);
    transform: scale(1);
  }
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

#folderInput {
  display: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #999;
  border-radius: 4px;
  background: #fff;
  padding: 6px 10px;
  cursor: pointer;
  user-select: none;
}

.layout {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.pane {
  flex: 1 1 0;
  min-width: 140px;
  overflow: auto;
  padding: 12px;
}

.pane h2 {
  margin: 0 0 12px 0;
  font-size: 14px;
}

.center-pane {
  background: #fafafa;
}

.left-pane-content {
  font-size: 13px;
  color: #333;
}

.left-pane-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.left-pane-table td {
  vertical-align: top;
  border: 1px solid #ddd;
  padding: 6px 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.left-pane-value-cell {
  cursor: pointer;
  transition: background-color 120ms linear;
}

.left-pane-value-cell.match-exact {
  background: rgba(70, 168, 92, 0.22);
}

.left-pane-value-cell.match-fuzzy {
  background: rgba(232, 194, 48, 0.28);
}

.left-pane-value-cell.match-none {
  background: rgba(224, 62, 62, 0.22);
}

.left-pane-table td:first-child {
  width: 38%;
  font-weight: 700;
  background: #f5f5f5;
}

.left-id-vyjadreni-value {
  display: inline-block;
  font-weight: 700;
}

.left-id-vyjadreni-value.is-pulsing {
  animation: leftPanelIdPulse 760ms ease-out 2;
  transform-origin: left center;
}

@keyframes leftPanelIdPulse {
  0% {
    color: #1f1f1f;
    text-shadow: 0 0 0 rgba(38, 120, 210, 0);
    transform: scale(1);
  }
  35% {
    color: #0f4ea3;
    text-shadow: 0 0 14px rgba(38, 120, 210, 0.7);
    transform: scale(2);
  }
  65% {
    color: #0f4ea3;
    text-shadow: 0 0 10px rgba(38, 120, 210, 0.55);
    transform: scale(1.3);
  }
  100% {
    color: #1f1f1f;
    text-shadow: 0 0 0 rgba(38, 120, 210, 0);
    transform: scale(1);
  }
}

.pdf-viewer {
  width: 100%;
  height: calc(100% - 30px);
  border: 1px solid #ddd;
  overflow: auto;
  background: #ededed;
}

.pdf-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px;
  min-height: 100%;
}

.pdf-page {
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
}

.pdf-page canvas {
  display: block;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  background: #fff;
}

.page-highlight-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.text-highlight {
  position: absolute;
  border-radius: 2px;
}

.text-highlight.match-exact {
  background: rgba(70, 168, 92, 0.35);
}

.text-highlight.match-fuzzy {
  background: rgba(232, 194, 48, 0.35);
}

.page-mask {
  position: absolute;
  inset: 0;
  background: rgba(120, 120, 120, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms linear;
}

.pdf-page.is-dimmed .page-mask {
  opacity: 1;
}

.resizer {
  width: 8px;
  cursor: col-resize;
  background: #e5e5e5;
  border-left: 1px solid #d0d0d0;
  border-right: 1px solid #d0d0d0;
}

.resizer:hover {
  background: #d7d7d7;
}
