/* Shared caption styles, copied byte for byte from their source; edit the source, never this copy. */
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--cc-btn-size, 32px);
  height: var(--cc-btn-size, 32px);
  padding: 0;
  border-radius: var(--cc-radius, 6px);
  border: 1px solid var(--cc-line, rgba(255, 255, 255, 0.2));
  background: var(--cc-btn-bg, rgba(15, 23, 42, 0.6));
  color: var(--cc-fg, rgba(255, 255, 255, 0.85));
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cc-btn[hidden] {
  display: none !important;
}

.cc-btn:hover {
  background: var(--cc-btn-hover-bg, rgba(255, 255, 255, 0.1));
  color: var(--cc-accent, #ffffff);
}

.cc-btn.is-active,
.cc-btn[aria-expanded="true"] {
  border-color: var(--cc-accent, #ffffff);
  color: var(--cc-accent, #ffffff);
  background: var(--cc-btn-active-bg, rgba(255, 255, 255, 0.15));
}

.cc-btn .gv-icon,
.cc-btn svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.cc-menu {
  position: absolute;
  z-index: 20;
  min-width: 220px;
  padding: 12px;
  border-radius: var(--cc-radius, 8px);
  background: var(--cc-menu-bg, rgba(20, 20, 20, 0.96));
  border: 1px solid var(--cc-line, rgba(255, 255, 255, 0.2));
  box-shadow: var(--cc-shadow, 0 8px 24px rgba(0, 0, 0, 0.5));
  color: var(--cc-fg, #ffffff);
  font-family: var(--cc-font, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: var(--cc-font-size, 12px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cc-menu[hidden] {
  display: none !important;
}

.cc-group {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cc-group[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}

.cc-group-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cc-muted, rgba(255, 255, 255, 0.6));
  margin-bottom: 2px;
}

.cc-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  line-height: 1.3;
}

.cc-option input[type="radio"] {
  margin-top: 2px;
  cursor: pointer;
}

.cc-option-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cc-option-label {
  font-weight: 500;
}

.cc-hint {
  font-size: 10px;
  color: var(--cc-hint-color, rgba(255, 255, 255, 0.5));
}

.cc-strip {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 4px;
  max-width: min(640px, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 12px;
  border-radius: var(--cc-radius, 8px);
  background: var(--cc-strip-bg, rgba(15, 23, 42, 0.8));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--cc-line, rgba(255, 255, 255, 0.15));
  color: var(--cc-fg, #ffffff);
  font-family: var(--cc-font, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: var(--cc-font-size, 13px);
  line-height: 1.4;
  pointer-events: none;
  box-sizing: border-box;
  z-index: 10;
}

.cc-strip[hidden] {
  display: none !important;
}

.cc-strip.cc-empty {
  visibility: hidden;
  height: 0;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-width: 0;
  overflow: hidden;
}

.cc-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.cc-line-sangai {
  text-align: left;
}

.cc-line-sang {
  text-align: right;
}

.cc-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cc-line-sang .cc-head {
  justify-content: flex-end;
}

.cc-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--cc-avatar-size, 20px);
  height: var(--cc-avatar-size, 20px);
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
}

.cc-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cc-avatar[data-failed="1"]::after {
  content: attr(data-fallback);
}

.cc-line.is-partial {
  opacity: 0.85;
}

.cc-speaker {
  font-weight: 600;
  flex-shrink: 0;
  color: var(--cc-speaker-color, #ffffff);
}

.cc-line-sang .cc-speaker {
  color: var(--cc-speaker-sang, rgba(255, 255, 255, 0.75));
}

.cc-text {
  flex: 1;
  min-width: 0;
}

@media (max-width: 700px) {
  .cc-strip {
    position: fixed;
    left: 14px;
    right: 14px;
    max-width: none;
    bottom: calc(var(--cc-strip-bottom, 0px) + env(safe-area-inset-bottom, 0px) + 8px);
  }
}
