/* src/viewer.css */
body {
  margin: 0;
  padding: 0;
  background-color: white;
  font-family: Arial, sans-serif;
}
#container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 100vw;
  overflow: hidden;
}
#main-content {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 20px;
  padding: 20px;
  padding-bottom: 10px;
}
#toc {
  width: 250px;
  display: flex;
  flex-direction: column;
  border: 1px solid #999;
  background-color: white;
  min-height: 0;
  overflow: hidden;
  font-size: 14px;
  color: #333;
}
#toc-header,
#transcription-header {
  background-color: white;
  border-bottom: 1px solid #999;
  padding: 15px 20px;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#toc-header h3,
#transcription-header h3 {
  margin: 0;
  color: #333;
  font-size: 16px;
}
#view-toggle {
  display: flex;
  gap: 0;
  border: 1px solid black;
  overflow: hidden;
}
.toggle-btn {
  background-color: white;
  border: none;
  padding: 6px 12px;
  font-size: 13px;
  color: #000;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  border-right: 1px solid black;
}
.toggle-btn:last-child {
  border-right: none;
}
.toggle-btn:hover {
  background-color: #f5f5f5;
}
.toggle-btn.active {
  background-color: black;
  color: white;
}
#toc-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  font-family: Arial, sans-serif;
  line-height: 1.4;
  color: #333;
}
#toc-content p {
  margin: 0 0 1em 0;
  color: #666;
}
.toc-item {
  display: block;
  cursor: pointer;
  color: #333;
  border-radius: 2px;
  padding: 4px 0px;
}
.toc-item:hover {
  background: #f5f5f5;
}
.toc-item[data-level="1"] {
  padding-left: 8px;
}
.toc-item[data-level="2"] {
  padding-left: 16px;
}
#viewer {
  flex: 1;
  min-height: 0;
  border: 1px solid #999;
  background-color: white;
}
#transcription-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid #999;
  background-color: white;
  min-height: 0;
}
#transcription-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  line-height: 1.6;
  color: #333;
}
#transcription-content p {
  margin: 0 0 1em 0;
  color: #666;
  font-style: normal;
}
#thumbnails {
  display: flex;
  overflow-x: auto;
  padding: 10px 20px 20px 20px;
  gap: 10px;
  background-color: white;
  border-top: 1px solid #999;
  justify-content: flex-start;
  align-items: center;
  min-height: 160px;
  flex-shrink: 0;
}
.thumbnail {
  flex-shrink: 0;
  min-width: 100px;
  cursor: pointer;
  border: 1px solid #999;
  border-radius: 0;
  padding: 8px;
  background-color: white;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.thumbnail:hover {
  border-color: #333;
}
.thumbnail.active {
  border-color: #333;
  background-color: white;
}
.thumbnail img {
  width: 100%;
  height: 150px;
  border-radius: 0;
  display: block;
  object-fit: contain;
  object-position: center;
}
.thumbnail-label {
  font-size: 10px;
  text-align: center;
  margin-top: 4px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  flex-shrink: 0;
}
.thumbnail.active .thumbnail-label {
  color: #333;
  font-weight: 400;
}
#thumbnails::-webkit-scrollbar {
  height: 8px;
}
#thumbnails::-webkit-scrollbar-track {
  background: white;
  border-radius: 0;
}
#thumbnails::-webkit-scrollbar-thumb {
  background: #999;
  border-radius: 0;
}
#thumbnails::-webkit-scrollbar-thumb:hover {
  background: #666;
}
@media (max-width: 768px) {
  #main-content {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    padding-bottom: 5px;
  }
  #transcription-header {
    padding: 10px 15px;
  }
  #transcription-header h3 {
    font-size: 14px;
    font-weight: 600;
  }
  #transcription-content {
    padding: 15px;
  }
  #toc {
    width: 100%;
    max-height: 260px;
  }
  #toc-content {
    padding: 12px 15px;
    max-height: 180px;
  }
  #thumbnails {
    padding: 10px;
    min-height: 100px;
  }
  .thumbnail {
    width: 80px;
    padding: 6px;
    min-height: 120px;
  }
  .thumbnail img {
    height: 90px;
  }
  .thumbnail-label {
    font-size: 9px;
  }
}
@media (max-width: 480px) {
  #main-content {
    gap: 5px;
    padding: 5px;
    padding-bottom: 5px;
  }
  #transcription-header {
    padding: 8px 12px;
  }
  #transcription-header h3 {
    font-size: 13px;
  }
  #transcription-content {
    padding: 12px;
    font-size: 14px;
  }
  #toc {
    max-height: 220px;
  }
  #toc-header {
    padding: 12px 14px;
  }
  #toc-content {
    padding: 10px 14px 14px;
  }
  #thumbnails {
    padding: 8px;
    gap: 8px;
    min-height: 90px;
  }
  .thumbnail {
    width: 70px;
    padding: 4px;
    min-height: 100px;
  }
  .thumbnail img {
    height: 75px;
  }
  .thumbnail-label {
    font-size: 8px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  #main-content {
    flex-direction: row;
    gap: 10px;
  }
  #thumbnails {
    min-height: 80px;
    padding: 8px 20px;
  }
  .thumbnail {
    width: 70px;
  }
  .thumbnail img {
    height: 60px;
  }
}
.r6o-annotatable .r6o-span-highlight-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  mix-blend-mode: multiply;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.r6o-annotatable .r6o-span-highlight-layer.hidden {
  display: none;
}
.r6o-annotatable .r6o-span-highlight-layer .r6o-annotation {
  position: absolute;
  display: block;
  border-style: solid;
  border-width: 0;
  box-sizing: content-box;
}
.r6o-canvas-highlight-layer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}
.r6o-canvas-highlight-layer.bg {
  mix-blend-mode: multiply;
  z-index: 1;
}
html,
body {
  overscroll-behavior-y: none;
}
.r6o-annotatable {
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.r6o-annotatable.no-focus-outline {
  outline: none;
}
.hovered * {
  cursor: pointer;
}
*::selection,
::selection {
  background: rgba(0, 128, 255, 0.18);
}
::-moz-selection,
::-moz-selection {
  background: rgba(0, 128, 255, 0.18);
}
