.timeline-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}

.timeline-options{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap:10px;
  margin-top:12px;
}

.timeline-option-check{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.timeline-option-check input[type="checkbox"]{
  width:auto;
  align-self:flex-start;
}

.film-box{
  margin-top:14px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  background:rgba(0,0,0,.14);
  padding:10px;
}

.film-head{
  font-size:12px;
  color:var(--muted);
  margin-bottom:8px;
}

.film-preview{
  width:100%;
  max-width:520px;
  max-height:220px;
  border-radius:10px;
  background:#0a0f1f;
  border:1px solid rgba(255,255,255,.14);
}

.film-stage{
  position:relative;
  width:fit-content;
  max-width:100%;
}

.film-stage .film-preview{
  display:block;
}

.film-overlay{
  position:absolute;
  inset:0;
  pointer-events:none;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:8px;
}

.film-overlay-tc{
  align-self:flex-start;
  font-size:12px;
  font-weight:700;
  letter-spacing:.4px;
  color:#fff;
  background:rgba(5,8,16,.68);
  border:1px solid rgba(255,255,255,.2);
  border-radius:8px;
  padding:3px 7px;
  text-shadow:0 1px 1px rgba(0,0,0,.7);
}

.film-overlay-line{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.film-overlay-badge{
  font-size:11px;
  color:#fff;
  background:rgba(5,8,16,.75);
  border:1px solid rgba(255,255,255,.2);
  border-radius:7px;
  padding:2px 7px;
  text-shadow:0 1px 1px rgba(0,0,0,.7);
}

.film-overlay-text{
  margin-top:6px;
  max-width:min(92%, 720px);
  max-height:38%;
  overflow:auto;
  font-size:12px;
  line-height:1.35;
  color:#fff;
  background:rgba(5,8,16,.78);
  border:1px solid rgba(255,255,255,.2);
  border-radius:9px;
  padding:6px 8px;
  text-shadow:0 1px 1px rgba(0,0,0,.7);
}

.timeline-header-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}

.timeline-filter-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:10px;
}

.timeline-filter-row label{
  display:flex;
  align-items:center;
  gap:8px;
}

.timeline-filter-row select{
  min-width:190px;
  border-radius:8px;
}

.timeline-table-wrap{
  overflow:auto;
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  background:rgba(0,0,0,.14);
  padding:8px;
  min-height:120px;
}

.timeline-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}

.timeline-table th,
.timeline-table td{
  border-bottom:1px solid rgba(255,255,255,.1);
  padding:6px 6px;
  text-align:left;
  vertical-align:top;
}

.timeline-table th{
  color:var(--muted);
  font-weight:700;
}

.timeline-table tbody tr{
  background:rgba(9,14,28,.92);
}

.timeline-table tbody tr:nth-child(even){
  background:rgba(232,240,255,.06);
}

.timeline-table tbody td{
  color:#eef3ff;
}

.timeline-table .col-select{
  width:40px;
  text-align:center;
}

.timeline-table .col-tc{ width:140px; }
.timeline-table .col-take{ width:140px; }
.timeline-table .col-character{ width:190px; }
.timeline-table .col-original{ min-width:280px; }
.timeline-table .col-sync{ min-width:280px; }

.timeline-table tr.row-selected{
  background:rgba(255,255,255,.08);
}

.timeline-table input,
.timeline-table textarea{
  width:100%;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.2);
  background:rgba(255,255,255,.08);
  color:#fff;
  padding:6px 7px;
  font-size:12px;
  line-height:1.25;
}

.timeline-table textarea{
  min-height:36px;
  resize:vertical;
}

.timeline-table input.timeline-row-select,
.timeline-table input.timeline-select-all{
  width:16px;
  height:16px;
  padding:0;
  margin:0;
  border-radius:4px;
}

@media (max-width:900px){
  .film-preview{max-height:180px;}
}


/* ADR Prep full workspace 2026-08-07 */
.adr-prep-grid{
  grid-template-columns:minmax(320px, 440px) minmax(520px, 1fr) minmax(260px, 320px);
  align-items:start;
}

.adr-prep-workspace,
.adr-prep-table-card,
.adr-prep-side-panel{
  min-width:0;
}

.adr-prep-tabs,
.adr-prep-side-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:12px;
}

.adr-prep-tab,
.adr-prep-side-tab{
  min-width:108px;
}

.adr-prep-tab.active,
.adr-prep-side-tab.active{
  border-color:rgba(255,214,102,.85);
  background:rgba(255,214,102,.22);
  color:#fff4d0;
}

.adr-prep-panel,
.adr-prep-side-body{
  display:none;
}

.adr-prep-panel.active,
.adr-prep-side-body.active{
  display:block;
}

.adr-prep-groups{
  display:grid;
  gap:12px;
  margin-top:12px;
}

.adr-prep-group{
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  background:rgba(0,0,0,.12);
  padding:12px;
}

.adr-prep-group h3{
  margin:0 0 10px;
  font-size:14px;
}

.adr-prep-simple-table{
  display:grid;
  gap:8px;
  margin-top:12px;
}

.adr-prep-simple-row{
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, 1fr) auto;
  gap:8px;
  align-items:center;
}

.adr-prep-simple-row.header{
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.adr-prep-simple-row .btn{
  min-width:42px;
}

.adr-prep-list{
  display:grid;
  gap:8px;
}

.adr-prep-list.empty{
  color:var(--muted);
}

.adr-prep-list-item{
  border:1px solid rgba(255,255,255,.10);
  border-radius:12px;
  background:rgba(0,0,0,.12);
  padding:8px 10px;
  font-size:12px;
  line-height:1.35;
}

.adr-prep-list-item.error{
  border-color:rgba(255,140,140,.55);
}

.adr-prep-list-item.warning{
  border-color:rgba(255,214,102,.55);
}

.adr-prep-list-item.info{
  border-color:rgba(95,163,255,.48);
}

.adr-prep-subtitle-source-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:8px;
  margin:12px 0;
}

.adr-prep-subtitle-source-grid > div{
  display:grid;
  gap:4px;
  min-width:0;
  padding:9px 11px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:12px;
  background:rgba(0,0,0,.12);
}

.adr-prep-subtitle-source-grid span{
  color:var(--muted);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.adr-prep-subtitle-preview{
  display:grid;
  gap:7px;
  max-height:430px;
  overflow:auto;
  padding:8px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  background:rgba(0,0,0,.14);
}

.adr-prep-subtitle-preview.empty{ color:var(--muted); }

.adr-prep-subtitle-cue{
  display:grid;
  grid-template-columns:46px minmax(180px,250px) 90px minmax(260px,1fr) minmax(140px,220px);
  gap:10px;
  align-items:start;
  padding:8px 10px;
  border-radius:10px;
  background:rgba(255,255,255,.045);
  font-size:12px;
}

.adr-prep-subtitle-cue.has-warning{ border-left:3px solid #ffd666; }
.adr-prep-subtitle-cue.has-error{ border-left:3px solid #ff8c8c; }
.adr-prep-subtitle-cue-text{ white-space:pre-line; font-size:14px; line-height:1.35; }
.adr-prep-subtitle-cue-meta{ color:var(--muted); }

@media (max-width:900px){
  .adr-prep-subtitle-cue{ grid-template-columns:42px 1fr; }
  .adr-prep-subtitle-cue-text,
  .adr-prep-subtitle-cue-meta{ grid-column:2; }
}

.adr-prep-side-panel{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.adr-prep-side-group{
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  background:rgba(0,0,0,.12);
  padding:12px;
}

.adr-prep-side-grow{
  flex:1 1 auto;
  min-height:280px;
}

.adr-prep-stat-list{
  display:grid;
  gap:8px;
}

.adr-prep-stat-list > div{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:6px 0;
  border-bottom:1px dashed rgba(255,255,255,.10);
}

.adr-prep-stat-list > div:last-child{
  border-bottom:none;
}

.adr-prep-stat-list strong{
  color:#fff;
}

.timeline-table tr.row-status-approved{
  background:rgba(110,220,160,.10);
}

.timeline-table tr.row-status-checked{
  background:rgba(120,190,255,.10);
}

.timeline-table .col-status{
  width:132px;
}

.timeline-table .status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:108px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.08);
  font-size:11px;
  font-weight:700;
}

.timeline-table .status-badge.checked{
  border-color:rgba(120,190,255,.7);
  background:rgba(120,190,255,.20);
}

.timeline-table .status-badge.approved{
  border-color:rgba(110,220,160,.7);
  background:rgba(110,220,160,.20);
}

@media (max-width: 1320px){
  .adr-prep-grid{
    grid-template-columns:minmax(320px, 1fr) minmax(0, 1fr);
  }
  .adr-prep-side-panel{
    grid-column:1 / -1;
  }
}

@media (max-width: 900px){
  .adr-prep-grid{
    grid-template-columns:1fr;
  }
  .adr-prep-simple-row{
    grid-template-columns:1fr;
  }
}

/* ADR Prep wide table + bulk character replace 2026-08-07 */
.adr-prep-grid{
  max-width:min(calc(100vw - 32px), 1920px) !important;
  width:min(calc(100vw - 32px), 1920px) !important;
  margin:0 auto !important;
  grid-template-columns:minmax(0, 1fr);
  align-items:start;
}

.adr-prep-workspace,
.adr-prep-table-card,
.adr-prep-side-panel{
  grid-column:1 / -1;
}

.adr-prep-table-card{
  overflow:hidden;
}

.timeline-filter-row{
  align-items:flex-end;
}

.timeline-filter-field{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:8px;
  min-width:200px;
  flex:1 1 200px;
}

.timeline-filter-field input,
.timeline-filter-field select{
  width:100%;
  min-width:0;
}

.timeline-filter-hint{
  flex:1 0 100%;
  margin-top:4px;
}

#btn-replace-characters{
  white-space:nowrap;
}

.timeline-table-wrap{
  width:100%;
}

.timeline-table{
  width:100%;
  min-width:1480px;
}

.timeline-table .col-tc{ width:148px; }
.timeline-table .col-take{ width:170px; }
.timeline-table .col-character{ width:240px; }
.timeline-table .col-original{ min-width:420px; }
.timeline-table .col-sync{ min-width:420px; }

/* Subtitle correction uses the center column without shrinking the ADR table. */
@media (min-width:1250px){
  .adr-prep-grid.subtitle-center-active{grid-template-columns:340px minmax(0,1fr) 250px;}
  .subtitle-center-active .adr-prep-workspace{grid-column:1;}
  .subtitle-center-active .adr-prep-table-card{grid-column:2;}
  .subtitle-center-active .adr-prep-side-panel{grid-column:3;}
  .subtitle-center-active .timeline-options{grid-template-columns:minmax(0,1fr);}
  .subtitle-center-active .timeline-options label{min-width:0;}
}
#adrprep-subtitle-preview .timeline-table{min-width:0;table-layout:fixed;}
#adrprep-subtitle-preview .timeline-table th:nth-child(1){width:35px;}
#adrprep-subtitle-preview .timeline-table th:nth-child(2),
#adrprep-subtitle-preview .timeline-table th:nth-child(3){width:110px;}
#adrprep-subtitle-preview .timeline-table th:nth-child(4){width:80px;}
#adrprep-subtitle-preview .timeline-table th:nth-child(5){width:90px;}
#adrprep-subtitle-preview .timeline-table th:nth-child(7){width:120px;}
#adrprep-subtitle-preview input,#adrprep-subtitle-preview textarea{min-width:0!important;width:100%;}
#adrprep-subtitle-preview[hidden],#adrprep-adr-center[hidden]{display:none!important;}

@media (max-width: 900px){
  .adr-prep-grid{
    width:min(calc(100vw - 20px), 1920px) !important;
    max-width:min(calc(100vw - 20px), 1920px) !important;
  }
  .timeline-filter-field{
    flex:1 1 100%;
    min-width:0;
  }
}


.adr-prep-voice-match-results{
  margin-top:16px;
  display:grid;
  gap:12px;
}
.adr-prep-voice-match-results.empty{
  padding:14px 16px;
  border:1px solid rgba(180, 195, 235, 0.22);
  border-radius:18px;
  background:rgba(10, 18, 42, 0.24);
  color:#b8c5eb;
}
.adr-prep-voice-match-card{
  border:1px solid rgba(180, 195, 235, 0.18);
  border-radius:18px;
  background:rgba(10, 18, 42, 0.24);
  padding:14px;
}
.adr-prep-voice-match-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.adr-prep-voice-match-list{
  display:grid;
  gap:8px;
}
.adr-prep-voice-match-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(255,255,255,0.04);
}
