/* Native YouTube controls only. The popup has its own independent stylesheet. */
button.yt-ct-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 6px;
  margin: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font:
    500 14px/20px Roboto,
    Arial,
    sans-serif;
  color: var(--yt-spec-text-primary, #0f0f0f);
  background: transparent;
  transition: background-color 140ms;
  vertical-align: top;
  position: relative;
}
html[dark] button.yt-ct-control {
  color: var(--yt-spec-text-primary, #f1f1f1);
}
button.yt-ct-control:hover {
  background: var(--yt-spec-10-percent-layer, rgba(0, 0, 0, 0.1));
}
html[dark] button.yt-ct-card:hover,
html[dark] button.yt-ct-shorts:hover,
html[dark]
  button.yt-ct-card:focus-visible:where(:not([data-ytct-pointer-focus])),
html[dark]
  button.yt-ct-shorts:focus-visible:where(:not([data-ytct-pointer-focus])) {
  background: var(--yt-spec-10-percent-layer, rgba(255, 255, 255, 0.1));
}
button.yt-ct-control:focus {
  outline: none;
  box-shadow: none;
}
/* Keyboard focus stays inside the existing control, without an extra marker. */
button.yt-ct-control:focus-visible:not([data-ytct-pointer-focus]) {
  background: var(--yt-spec-10-percent-layer, rgba(0, 0, 0, 0.1));
}
.yt-ct-control .yt-ct-icon-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
}
.yt-ct-control .yt-ct-icon {
  width: 24px;
  height: 24px;
  display: block;
}
.yt-ct-control[data-state="loading"] .yt-ct-icon-slot {
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  box-sizing: border-box;
  animation: ytct-spin 0.8s linear infinite;
}
.yt-ct-control[data-state="loading"] svg {
  display: none;
}
/* The copy button never participates in YouTube's mutable menu layout. */
button.yt-ct-card {
  width: var(--ytct-card-width, 40px);
  min-width: 0;
  height: var(--ytct-card-height, 40px);
  border-radius: var(--ytct-card-radius, 50%);
  padding: 0;
  transition: var(--ytct-card-transition, none);
  position: absolute !important;
  right: auto !important;
  flex: none !important;
  z-index: 2;
  visibility: visible;
}
/* Modern cards inherit the native Text/Mono hover rule. These fallbacks use
   YouTube's stronger menu overlay instead of the old 10-percent chip layer. */
button.yt-ct-card:hover,
button.yt-ct-card:focus-visible:not([data-ytct-pointer-focus]) {
  background: var(--yt-spec-button-chip-background-hover, rgba(0, 0, 0, 0.1));
}
html[dark] button.yt-ct-card:hover,
html[dark] button.yt-ct-card:focus-visible:not([data-ytct-pointer-focus]) {
  background: var(--yt-spec-button-chip-background-hover, rgba(255, 255, 255, 0.2));
}
button.yt-ct-control[hidden] {
  display: none !important;
}
[data-yt-ct-relative] {
  position: relative !important;
}
[data-yt-ct-flow] {
  margin-inline-start: 44px !important;
}
yt-lockup-metadata-view-model:has(.yt-ct-card) {
  padding-inline-end: 84px !important;
  box-sizing: border-box;
}
/* Native tonal classes supply YouTube's theme/hover surface when available.
   Explicit fallbacks cover older layouts without those classes or tokens. */
button.yt-ct-watch {
  --ytct-watch-base: rgba(0, 0, 0, 0.05);
  --ytct-watch-hover: rgba(0, 0, 0, 0.1);
  background: var(--ytct-watch-base);
}
html[dark] button.yt-ct-watch {
  --ytct-watch-base: rgba(255, 255, 255, 0.1);
  --ytct-watch-hover: rgba(255, 255, 255, 0.2);
}
button.yt-ct-watch:hover,
button.yt-ct-watch:focus-visible:not([data-ytct-pointer-focus]) {
  background: var(--ytct-watch-hover);
}
button.yt-ct-control.yt-ct-watch {
  display: inline-grid;
  grid-template-columns: auto;
  align-items: center;
  width: auto;
  height: var(--ytct-watch-height, 40px);
  border-radius: var(--ytct-watch-radius, 20px);
  padding: 0 var(--ytct-watch-padding, 16px);
  column-gap: 0;
  margin-inline-start: 8px;
  font: var(--ytct-watch-font, 500 14px/40px Roboto, Arial, sans-serif);
  text-decoration: none;
  transition: var(--ytct-watch-transition, none);
}
.ytct-watch-content {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: var(--ytct-watch-gap, 6px);
  position: relative;
  z-index: 1;
}
.yt-ct-watch .yt-ct-label {
  white-space: nowrap;
  text-decoration: none !important;
  position: relative;
  z-index: 1;
}
/* Reserve the normal label width so Copied/Failed never moves nearby actions. */
button.yt-ct-watch::after {
  content: "Copy transcript";
  visibility: hidden;
  grid-area: 1 / 1;
  padding-inline-start: calc(
    var(--ytct-watch-icon-size, 24px) + var(--ytct-watch-gap, 6px)
  );
  white-space: nowrap;
  pointer-events: none;
}
.yt-ct-watch .yt-ct-icon-slot {
  width: var(--ytct-watch-icon-size, 24px);
  height: var(--ytct-watch-icon-size, 24px);
  position: relative;
  z-index: 1;
}
.yt-ct-watch .yt-ct-icon {
  width: 100%;
  height: 100%;
}
.ytct-native-light,
.ytct-native-touch {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.yt-ct-watch:active .ytSpecTouchFeedbackShapeFill,
.yt-ct-watch:focus-visible:not([data-ytct-pointer-focus])
  .ytSpecTouchFeedbackShapeFill {
  opacity: 0.1;
}
button.yt-ct-shorts {
  width: 40px;
  height: 40px;
  background: var(--yt-spec-badge-chip-background, rgba(128, 128, 128, 0.22));
  margin-block: 8px;
}
.yt-ct-live {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  pointer-events: none;
}
@keyframes ytct-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  button.yt-ct-control {
    transition: none;
  }
  .yt-ct-control[data-state="loading"] .yt-ct-icon-slot {
    animation: none;
    border-style: dashed;
  }
}

.shortsLockupViewModelHostOutsideMetadata:has(.yt-ct-card) {
  padding-inline-end: 84px !important;
}

.yt-ct-tooltip {
  position: fixed;
  z-index: 2147483647;
  max-width: min(330px, calc(100vw - 16px));
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #68686e;
  border-radius: 8px;
  background: #222226;
  color: #fff;
  box-shadow: 0 4px 18px #0005;
  font:
    13px/1.45 system-ui,
    -apple-system,
    sans-serif;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  pointer-events: auto;
}
.yt-ct-tooltip[hidden] {
  display: none !important;
}

/* Shared feedback language: green check, red failure, no movement of the control. */
button.yt-ct-control {
  --ytct-success: #188038;
  --ytct-failure: #c5221f;
  transition:
    background-color 150ms,
    color 150ms;
}
button.yt-ct-control.yt-ct-card {
  transition: var(--ytct-card-transition, none);
}
html[dark] button.yt-ct-control {
  --ytct-success: #7de9a1;
  --ytct-failure: #ff8d8d;
}
button.yt-ct-control[data-state="copied"],
html[dark] button.yt-ct-control[data-state="copied"] {
  color: var(--ytct-success);
  background: rgba(24, 128, 56, 0.12);
}
button.yt-ct-control[data-state="error"],
button.yt-ct-control[data-state="unavailable"],
html[dark] button.yt-ct-control[data-state="error"],
html[dark] button.yt-ct-control[data-state="unavailable"] {
  color: var(--ytct-failure);
  background: rgba(197, 34, 31, 0.1);
}
.yt-ct-control[data-state="copied"] .yt-ct-icon-slot {
  animation: ytct-success-pop 240ms cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
.yt-ct-control[data-state="copied"] .yt-ct-icon path {
  stroke-dasharray: 28;
  stroke-dashoffset: 0;
  animation: ytct-check-draw 240ms ease-out both;
}
.yt-ct-control[data-state="error"] .yt-ct-icon-slot {
  animation: ytct-failure-shake 240ms ease-out both;
}
@keyframes ytct-success-pop {
  0% {
    transform: scale(0.75);
    opacity: 0.35;
  }
  65% {
    transform: scale(1.12);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes ytct-check-draw {
  from {
    stroke-dashoffset: 28;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes ytct-failure-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  50% {
    transform: translateX(2px);
  }
  75% {
    transform: translateX(-1px);
  }
}
@media (prefers-reduced-motion: reduce) {
  button.yt-ct-control {
    transition: none;
  }
  .yt-ct-control .yt-ct-icon-slot,
  .yt-ct-control .yt-ct-icon path {
    animation: none !important;
  }
}

/* Keep state feedback visible even when YouTube's native hover selector matches. */
button.yt-ct-control:is(.yt-ct-watch, .yt-ct-card)[data-state="copied"]:hover {
  background: rgba(24, 128, 56, 0.2);
}
button.yt-ct-control:is(.yt-ct-watch, .yt-ct-card)[data-state="error"]:hover,
button.yt-ct-control:is(.yt-ct-watch, .yt-ct-card)[data-state="unavailable"]:hover {
  background: rgba(197, 34, 31, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  button.yt-ct-control.yt-ct-watch {
    transition: none;
  }
}

.ytct-copy-content {
  display: flex;
}

@media (prefers-reduced-motion: no-preference) {
  button.yt-ct-control[data-yt-ct-owned]:is(.yt-ct-card, .yt-ct-shorts) > .ytct-copy-content {
    transition: scale 130ms ease-out;
  }
  button.yt-ct-control[data-yt-ct-owned]:active > .ytct-copy-content {
    scale: 0.92;
  }
}
