/* Subtitle Studio — professional desktop workspace */
.tr-subtitle-lab .tr-quick-start,
.tr-subtitle-lab .workflow,
.tr-subtitle-lab .settings,
.tr-subtitle-lab .tr-advanced-recognition{display:none!important}

/* Give a desktop editing tool the width it actually needs. */
.tr-subtitle-lab .shell{
  max-width:1440px!important;
  padding:0 28px!important;
}
.tr-subtitle-lab .tr-header-inner,
.tr-subtitle-lab .tr-site-footer,
.tr-subtitle-lab .hero.tr-creator-hero{
  max-width:1080px!important;
}
.tr-subtitle-lab .hero.tr-creator-hero{
  margin-inline:auto!important;
  padding:18px 32px 10px!important;
}
.tr-subtitle-lab .tr-creator-hero .hero-copy{max-width:760px!important}
.tr-subtitle-lab .tr-creator-hero h1{
  font-size:clamp(1.9rem,3vw,2.4rem)!important;
}
.tr-subtitle-lab .tr-creator-hero .lead{
  margin-top:7px!important;
  font-size:.875rem!important;
  line-height:1.55!important;
}

/* One compact command surface instead of three oversized onboarding cards. */
.tr-project-bar{
  margin:0 0 16px;
  overflow:hidden;
  border:1px solid var(--tr-line);
  border-radius:16px;
  background:var(--tr-surface);
}
.tr-project-grid{
  display:grid;
  grid-template-columns:minmax(260px,.82fr) minmax(400px,1.16fr) minmax(350px,1.02fr);
  min-height:156px;
}
.tr-project-step{
  position:relative;
  min-width:0;
  padding:18px 18px 16px 52px;
  background:var(--tr-surface);
}
.tr-project-step+.tr-project-step{border-left:1px solid var(--tr-line)}
.tr-step-index{
  position:absolute;
  top:19px;
  left:18px;
  width:24px;
  height:24px;
  display:grid;
  place-items:center;
  border:1px solid var(--tr-line);
  border-radius:7px;
  background:var(--tr-soft);
  color:var(--tr-muted);
  font-size:.62rem;
  font-weight:800;
  letter-spacing:.04em;
}
.tr-project-step-body{min-width:0}
.tr-project-step-head{
  min-width:0;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.tr-project-label{
  margin:0 0 3px;
  color:var(--tr-success);
  font-size:.64rem;
  font-weight:800;
  letter-spacing:.1em;
}
.tr-project-step strong{
  display:block;
  color:var(--tr-ink);
  font-size:.96rem;
  line-height:1.25;
  letter-spacing:-.01em;
}
.tr-step-state{
  flex:none;
  padding:4px 7px;
  border:1px solid var(--tr-line);
  border-radius:999px;
  background:var(--tr-soft);
  color:var(--tr-muted);
  font-size:.64rem;
  font-weight:700;
  white-space:nowrap;
}
.tr-project-copy{
  margin:7px 0 0;
  color:var(--tr-muted);
  font-size:.72rem;
  line-height:1.45;
}
.tr-source-actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:13px;
}
.tr-action,
.tr-jump-editor{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:38px;
  padding:7px 10px;
  border-radius:8px;
  font-size:.75rem;
  font-weight:700;
  text-decoration:none!important;
  cursor:pointer;
}
.tr-action-primary{
  border:1px solid var(--tr-ink);
  background:var(--tr-ink);
  color:var(--tr-on-solid)!important;
}
.tr-action-secondary,
.tr-jump-editor{
  border:1px solid var(--tr-control);
  background:var(--tr-surface);
  color:var(--tr-ink)!important;
}
.tr-action-secondary:hover,
.tr-jump-editor:hover{background:var(--tr-soft)}
.tr-action-icon{
  width:18px;
  height:18px;
  display:grid;
  place-items:center;
  border-radius:5px;
  font-size:.85rem;
}
.tr-source-status{
  margin:9px 0 0;
  color:var(--tr-muted);
  font-size:.68rem;
  line-height:1.35;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.tr-project-bar.has-media .tr-project-source .tr-step-state,
.tr-project-bar.has-subtitles .tr-project-source .tr-step-state{
  border-color:color-mix(in srgb,var(--tr-success) 38%,var(--tr-line));
  background:var(--tr-success-bg);
  color:var(--tr-success);
}

/* Moonshine controls are compact and subordinate to the actual work. */
.tr-transcription-slot{
  display:flex;
  flex-wrap:wrap;
  align-items:stretch;
  gap:7px;
  margin-top:12px;
}
.tr-asr-engine{
  flex:1 1 230px;
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:40px;
  padding:7px 9px;
  border:1px solid var(--tr-line);
  border-radius:8px;
  background:var(--tr-soft);
}
.tr-asr-engine>span:first-child{min-width:0}
.tr-asr-engine strong{
  display:block;
  font-size:.74rem;
  line-height:1.2;
}
.tr-asr-engine small{
  display:block;
  margin-top:2px;
  color:var(--tr-muted);
  font-size:.62rem;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.tr-asr-backend{
  flex:none;
  padding:3px 6px;
  border:1px solid var(--tr-line);
  border-radius:999px;
  background:var(--tr-surface);
  color:var(--tr-muted);
  font-size:.61rem;
  font-weight:750;
}
.tr-local-recognize{
  flex:0 0 172px;
  min-height:40px!important;
  margin:0!important;
  padding:7px 10px!important;
  border:1px solid var(--tr-ink)!important;
  border-radius:8px!important;
  background:var(--tr-ink)!important;
  color:var(--tr-on-solid)!important;
  font-size:.74rem!important;
  font-weight:750;
  white-space:nowrap;
}
.tr-local-recognize:disabled{opacity:.38!important;cursor:not-allowed!important}
.tr-local-cancel{
  flex:0 0 auto;
  min-height:40px!important;
  margin:0!important;
  padding:7px 10px!important;
  border:1px solid var(--tr-control)!important;
  border-radius:8px!important;
  background:var(--tr-surface)!important;
  color:var(--tr-ink)!important;
  font-size:.72rem!important;
}
#local-asr-progress{
  flex:1 0 100%;
  width:100%;
  height:4px;
  margin:1px 0 0;
  accent-color:var(--tr-success);
}
.tr-service-state{margin-top:7px}
.tr-local-status{
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  color:var(--tr-muted);
  font-size:.67rem;
  line-height:1.35;
}
.tr-service-state.is-working .tr-local-status{color:var(--tr-success)}
.tr-service-state.is-error .tr-local-status{color:#a25514}

.tr-project-review .tr-jump-editor{
  margin-top:13px;
  width:100%;
  min-height:40px;
}

/* Workspace begins immediately; no instructional card between setup and work. */
.tr-workspace-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  margin:0 0 10px;
  padding:0 2px;
}
.tr-workspace-kicker{
  margin:0 0 2px;
  color:var(--tr-success);
  font-size:.63rem;
  font-weight:800;
  letter-spacing:.1em;
}
.tr-workspace-head h2{
  margin:0;
  color:var(--tr-ink);
  font-size:1.05rem;
  line-height:1.25;
  letter-spacing:-.02em;
}
.tr-workspace-meta{
  display:flex;
  align-items:center;
  gap:7px;
}
.tr-workspace-meta span{
  padding:4px 7px;
  border:1px solid var(--tr-line);
  border-radius:999px;
  background:var(--tr-surface);
  color:var(--tr-muted);
  font-size:.64rem;
  font-weight:650;
}

.tr-subtitle-lab .workspace.tr-studio-workspace{
  display:block!important;
  margin:0!important;
}
.tr-subtitle-lab .editing.tr-editor-primary{
  display:grid!important;
  grid-template-columns:minmax(0,1.08fr) minmax(430px,.92fr)!important;
  gap:14px!important;
  align-items:start!important;
  width:100%!important;
}
.tr-subtitle-lab .tr-preview-pane,
.tr-subtitle-lab .tr-editor-pane{
  min-width:0;
  margin:0!important;
  border:1px solid var(--tr-line)!important;
  border-radius:14px!important;
  background:var(--tr-surface)!important;
  box-shadow:none!important;
}
.tr-subtitle-lab .tr-preview-pane{
  position:sticky;
  top:92px;
  overflow:hidden;
  padding:14px!important;
}
.tr-subtitle-lab .tr-preview-pane video,
.tr-subtitle-lab .tr-preview-pane audio{
  width:100%!important;
}
.tr-subtitle-lab .tr-preview-pane video{
  display:block;
  aspect-ratio:16/9;
  max-height:560px;
  object-fit:contain;
  border-radius:10px;
  background:#0b1013;
}
.tr-subtitle-lab .tr-editor-pane{
  min-height:620px;
  max-height:calc(100vh - 102px);
  overflow:auto!important;
  padding:0!important;
}
.tr-subtitle-lab .editor-heading{
  position:sticky;
  top:0;
  z-index:12;
  margin:0!important;
  padding:14px 15px 7px!important;
  background:var(--tr-surface)!important;
}
.tr-subtitle-lab .editor-heading h1,
.tr-subtitle-lab .editor-heading h2,
.tr-subtitle-lab .editor-heading h3{
  margin:0!important;
  font-size:1rem!important;
  letter-spacing:-.015em!important;
}
.tr-editor-hint{
  position:sticky;
  top:40px;
  z-index:11;
  margin:0!important;
  padding:0 15px 10px;
  border-bottom:1px solid var(--tr-line);
  background:var(--tr-surface);
  color:var(--tr-muted);
  font-size:.68rem;
  line-height:1.4;
}
.tr-subtitle-lab .editor-tabs{
  position:sticky;
  top:74px;
  z-index:10;
  background:var(--tr-surface)!important;
  border-color:var(--tr-line)!important;
}
.tr-subtitle-lab .timeline-guard{
  margin:10px 12px!important;
  padding:9px 10px!important;
  border-color:var(--tr-line)!important;
  background:var(--tr-success-bg)!important;
  border-radius:8px!important;
}
.tr-subtitle-lab .cue-row{
  padding:9px 12px!important;
  border-color:var(--tr-line)!important;
}
.tr-subtitle-lab .cue-row textarea{
  min-height:62px!important;
  background:var(--tr-soft)!important;
  line-height:1.5!important;
}
.tr-subtitle-lab .export-bar{
  position:sticky!important;
  bottom:0!important;
  z-index:20!important;
  border-top:1px solid var(--tr-line)!important;
  background:color-mix(in srgb,var(--tr-surface) 95%,transparent)!important;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.tr-subtitle-lab .editor-status,
.tr-subtitle-lab .notice{
  background:var(--tr-soft)!important;
  color:var(--tr-muted)!important;
}

/* Tablet: project controls become two rows, workspace stacks. */
@media(max-width:1120px){
  .tr-project-grid{
    grid-template-columns:1fr 1.2fr;
  }
  .tr-project-review{
    grid-column:1/-1;
    min-height:0;
    padding-top:13px;
    padding-bottom:13px;
  }
  .tr-project-review .tr-project-step-body{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:16px;
  }
  .tr-project-review .tr-project-copy{margin-top:4px}
  .tr-project-review .tr-jump-editor{
    grid-column:2;
    grid-row:1/3;
    width:auto;
    min-width:150px;
    margin:0;
  }
  .tr-subtitle-lab .editing.tr-editor-primary{
    grid-template-columns:1fr!important;
  }
  .tr-subtitle-lab .tr-preview-pane{
    position:relative;
    top:auto;
  }
  .tr-subtitle-lab .tr-editor-pane{
    max-height:none;
  }
}

@media(max-width:760px){
  .tr-subtitle-lab .shell{padding:0 16px!important}
  .tr-subtitle-lab .hero.tr-creator-hero{padding:20px 0 12px!important}
  .tr-project-grid{grid-template-columns:1fr}
  .tr-project-step{
    min-height:0;
    padding:15px 15px 14px 48px;
  }
  .tr-project-step+.tr-project-step{border-left:0;border-top:1px solid var(--tr-line)}
  .tr-step-index{top:16px;left:15px}
  .tr-project-review{grid-column:auto}
  .tr-project-review .tr-project-step-body{display:block}
  .tr-project-review .tr-jump-editor{
    width:100%;
    min-width:0;
    margin-top:11px;
  }
  .tr-transcription-slot{display:grid;grid-template-columns:1fr}
  .tr-asr-engine,
  .tr-local-recognize,
  .tr-local-cancel{
    width:100%!important;
    flex-basis:auto;
  }
  .tr-workspace-head{
    align-items:flex-start;
  }
  .tr-workspace-meta{display:none}
  .tr-subtitle-lab .tr-editor-pane{min-height:460px}
}

@media(max-width:520px){
  .tr-source-actions{display:grid;grid-template-columns:1fr}
  .tr-action{width:100%}
  .tr-project-step-head{align-items:center}
  .tr-asr-engine small{white-space:normal}
}




/* Local subtitle translation */
.tr-translation-slot{
  width:100%;
  margin-top:10px;
}
.tr-translate-control{
  display:grid;
  grid-template-columns:minmax(105px,1fr) 18px minmax(105px,1fr);
  align-items:end;
  gap:6px;
}
.tr-translate-field{
  display:grid;
  gap:3px;
  min-width:0;
}
.tr-translate-field>span{
  color:var(--tr-muted);
  font-size:.58rem;
  font-weight:760;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.tr-translate-field select{
  width:100%;
  min-height:34px;
  padding:5px 25px 5px 7px!important;
  border:1px solid var(--tr-line)!important;
  border-radius:7px!important;
  background:var(--tr-soft)!important;
  color:var(--tr-ink)!important;
  font-size:.66rem!important;
}
.tr-translate-arrow{
  height:34px;
  display:grid;
  place-items:center;
  color:var(--tr-muted);
  font-size:.78rem;
}
.tr-translate-mode{
  grid-column:1/-1;
  margin-top:1px;
}
.tr-translate-actions{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:7px;
}
.tr-translate-button,
.tr-translate-secondary{
  min-height:34px!important;
  margin:0!important;
  padding:5px 9px!important;
  border-radius:7px!important;
  font-size:.66rem!important;
  font-weight:740!important;
}
.tr-translate-button{
  flex:1 1 130px;
  border:1px solid var(--tr-ink)!important;
  background:var(--tr-ink)!important;
  color:var(--tr-on-solid)!important;
}
.tr-translate-secondary{
  flex:0 1 auto;
  border:1px solid var(--tr-control)!important;
  background:var(--tr-surface)!important;
  color:var(--tr-ink)!important;
}
.tr-translate-button:disabled{opacity:.42!important;cursor:not-allowed!important}
#tr-translate-progress{
  width:100%;
  height:4px;
  margin:7px 0 0;
  accent-color:var(--tr-success);
}
.tr-translate-status{
  margin:5px 0 0!important;
  color:var(--tr-muted);
  font-size:.61rem;
  line-height:1.35;
}
.tr-translation-slot.is-working .tr-translate-status,
.tr-translation-slot.is-success .tr-translate-status{color:var(--tr-success)}
.tr-translation-slot.is-error .tr-translate-status{color:#a25514}
.tr-project-review .tr-jump-editor{
  margin-top:8px;
}

@media(max-width:1120px){
  .tr-project-review .tr-translation-slot{
    grid-column:1;
    max-width:680px;
  }
}
@media(max-width:760px){
  .tr-translate-control{
    grid-template-columns:1fr 18px 1fr;
  }
  .tr-translate-actions{display:grid;grid-template-columns:1fr 1fr}
  .tr-translate-button{grid-column:1/-1}
}
@media(max-width:460px){
  .tr-translate-control{grid-template-columns:1fr}
  .tr-translate-arrow{display:none}
  .tr-translate-mode{grid-column:auto}
  .tr-translate-actions{grid-template-columns:1fr}
  .tr-translate-button{grid-column:auto}
}
