#transcript-section {
  position: absolute;
  left: 0;
  width: 100%;
  z-index: 10;
  pointer-events: none;
  border-radius: 8px;
  overflow: hidden;
  background-color: rgba(18, 24, 38, var(--transcript-bg-alpha));
  font-size: var(--transcript-font-size);
  bottom: 0;
  height: var(--transcript-height);
  display: flex;
  flex-direction: column;
}

#transcript-section.disable-transform {
  transform: none;
}

#transcript-section:not(.has-transcript) #transcript-search-controls,
body:not(.show-transcript-search) #transcript-search-controls {
    display: none;
}

#transcript-search-controls {
  padding: 0.5rem 1rem;
  background-color: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  pointer-events: auto;
  border-bottom: 1px solid var(--border-color);
}

#transcript-search-input {
  flex-grow: 1;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: var(--primary-text-color);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
}

#transcript-search-input::placeholder {
  color: var(--secondary-text-color);
}

#search-results-count {
  font-size: 0.8rem;
  color: var(--secondary-text-color);
  min-width: 45px;
  text-align: right;
  font-family: 'Courier New', Courier, monospace;
}

#transcript-search-controls button {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: var(--primary-text-color);
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  font-weight: bold;
  transition: all 0.2s ease;
}

#transcript-search-controls button:hover {
  background-color: var(--accent-color);
  color: var(--bg-color);
}

#clear-search-btn {
  font-size: 1.2rem;
  padding: 0.1rem 0.6rem;
}

#transcript-container {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  padding-left: var(--transcript-horizontal-margin);
  padding-right: var(--transcript-horizontal-margin);
  line-height: 1.8;
  box-sizing: border-box;
  pointer-events: auto; /* Fix: Re-enable pointer events for the container to capture clicks/contextmenu for its children. */
}

/* Custom Scrollbar for Transcript */
#transcript-container::-webkit-scrollbar {
  width: 8px;
}
#transcript-container::-webkit-scrollbar-track {
  background: transparent;
}
#transcript-container::-webkit-scrollbar-thumb {
  background: var(--secondary-text-color);
  border-radius: 4px;
}
#transcript-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

.word .more-btn {
    display: inline-block;
    background-color: #444;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    margin-left: 5px;
    font-size: 12px;
}

.word .more-btn:hover {
    background-color: #666;
}