/* The dub's page, Lồng tiếng (frontend/panel/dubbing.js), in the panel's own look (D23): its tabs are built of
   Cài đặt's parts from theme.css and panel.css (frontend/panel/dubbing/fields.js), and these around them.
   The quick menu on youtube.com keeps the source's Tailwind look, frontend/dub-ui/dub-ui.css. */
.dub-tab .section-title:first-child {
  margin-top: 24px;
}
.dub-intro {
  margin: -12px 0 20px;
}
/* A row's control goes under its words where both do not fit side by side (a phone). */
.dub-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.dub-row-text {
  flex: 1 1 240px;
  min-width: 0;
}
.dub-row-title {
  color: var(--text-strong);
}
.dub-row-control {
  flex: none;
}
.dub-switch {
  margin: 0 0 14px;
}
.dub-switch .switch {
  margin: 0;
}
/* The sentence under a switch starts under its words: the track and its margins are 48 px. */
.dub-switch-hint {
  margin-left: 48px;
}
.dub-switch.is-busy .switch {
  opacity: 0.6;
  cursor: progress;
}
.dub-note {
  padding: 16px 0;
}
.dub-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-soft);
}
.dub-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}
.dub-list-row a {
  min-width: 0;
  overflow: hidden;
  color: var(--text-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dub-add {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}
.dub-icon-button {
  display: inline-flex;
  padding: 6px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.dub-icon-button:hover {
  background: var(--hover);
  color: var(--selected-text);
}
.dub-icon-button.is-danger:hover {
  color: var(--danger);
}
.dub-icon-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* Giao diện chính (popup-rows.js): fields side by side while they fit, one under another on a phone. */
.dub-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 16px;
}
.dub-fields .select-wrap {
  width: 100%;
}
.dub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}
/* Its blue and outlined buttons side by side are one height. */
.dub-actions > button {
  height: 36px;
}
.dub-row-value {
  color: var(--text-strong);
  font-weight: 500;
}
/* The member's days left: the card's gold badge, in the panel's colours. */
.dub-pro {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--saved) 12%, transparent);
  color: var(--saved);
  white-space: nowrap;
}
.dub-speaker .select-wrap {
  flex: 1;
  width: auto;
}
.dub-speaker-number {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--bg);
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}
/* A slider's value beside it (Cài đặt's range-field) keeps its width as it moves. */
.dub-tab .range-value {
  min-width: 48px;
  color: var(--text-label);
  font-variant-numeric: tabular-nums;
}
/* Kiểu phụ đề (subtitle-style.js): the editor's two views, the preview, the number fields, the swatches. */
.dub-segments {
  display: inline-flex;
  gap: 4px;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}
.dub-segment {
  padding: 6px 16px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-muted);
  font: 500 14px/20px var(--font);
  cursor: pointer;
}
.dub-segment:hover {
  color: var(--selected-text);
}
.dub-segment.is-on {
  background: var(--selected);
  color: var(--selected-text);
}
/* The source's frame: its bg-gray-900, 16:9, its column 768 px wide at most (options:7698, max-w-[896px] less its padding), 240 px high on a phone. */
.dub-preview {
  position: relative;
  max-width: 768px;
  margin: 0 0 24px;
  overflow: hidden;
  border-radius: 12px;
  background: #111827;
}
.dub-preview-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--on-media);
  font-size: 12px;
}
.dub-preview-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
@media (max-width: 767px) {
  .dub-preview-frame {
    max-height: 240px;
  }
}
.dub-preview-shade {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 33%;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.6));
  pointer-events: none;
}
.dub-preview-text {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.dub-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dub-inline .select-wrap {
  flex: 1;
  min-width: 0;
}
/* A number with its unit in the panel's input box (.search-field), as wide as a few digits. */
.dub-number {
  display: inline-flex;
  align-items: center;
  flex: none;
  width: 96px;
  box-sizing: border-box;
}
.dub-number:focus-within {
  border-color: var(--accent);
}
.dub-number-input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: right;
  outline: none;
}
.dub-number-unit {
  margin-left: 4px;
  color: var(--text-muted);
}
.dub-swatch {
  flex: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
}
/* The original's controls while it follows the translation's style (the source's pointer-events-none opacity-50, options:7148-7351). */
.dub-dimmed {
  opacity: 0.5;
  pointer-events: none;
}
/* Dịch bằng AI (ai-translation.js and its lists, rule-parts.js): the pills, the search form, the table a wide page
   shows and the cards a phone shows (the source's md: at 768 px), the pages row and the sheets. */
.dub-rules .dub-segments {
  margin-top: 8px;
}
.dub-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.dub-row-text .dub-pills + .dub-pills {
  margin-top: 8px;
}
.dub-pill {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--text-label);
  font-size: 12px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dub-pill.is-on {
  background: color-mix(in srgb, var(--lang) 20%, transparent);
  color: var(--lang-text);
}
.dub-pill.is-blocked {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}
.dub-pill.is-user {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent-soft);
}
.dub-pill.is-off {
  color: var(--text-muted);
}
.dub-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0 16px;
}
.dub-search .select-wrap {
  width: 180px;
}
.dub-table-wrap {
  overflow-x: auto;
}
.dub-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}
.dub-table th {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}
.dub-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 14px;
}
.dub-table tbody tr:hover {
  background: var(--hover);
}
.dub-table .is-end {
  text-align: right;
}
.dub-table td.is-muted {
  color: var(--text-muted);
}
.dub-cell-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dub-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}
.dub-cards {
  display: none;
}
.dub-card {
  margin: 0 0 12px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}
.dub-card-texts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  color: var(--text-strong);
  font-weight: 500;
}
/* A card's text, two lines at most (the source's mobile-line-clamp-2, options.css:1-8). */
.dub-card-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}
.dub-card-arrow {
  color: var(--text-muted);
}
.dub-card .dub-pills {
  margin-top: 12px;
}
.dub-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.dub-card-bottom .switch {
  margin: 0;
}
@media (max-width: 767px) {
  .dub-table-wrap {
    display: none;
  }
  .dub-cards {
    display: block;
  }
}
.dub-table .switch {
  margin: 0;
}
.dub-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
}
.dub-pages-buttons {
  display: flex;
  gap: 8px;
}
/* The sheets: at the page's right over its dimmed rest, above everything (the source's z-[2147483647], options:4017-4027). */
.dub-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.5);
}
.dub-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.dub-sheet.is-wide {
  max-width: 576px;
}
.dub-sheet.is-narrow {
  max-width: 448px;
}
.dub-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.dub-sheet-heading {
  min-width: 0;
}
.dub-sheet-title {
  margin: 0 0 4px;
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 600;
}
.dub-sheet-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.dub-sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}
.dub-sheet-body .select-wrap {
  width: 100%;
}
.dub-sheet-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--line-soft);
}
.dub-total {
  margin: 16px 0 0;
}
