.subtitle-speed {
  --sc-ink: #172422;
  --sc-muted: #4f615d;
  --sc-line: #d7e1dd;
  --sc-field: #aebfba;
  --sc-soft: #f3f8f5;
  --sc-action: #17604e;
  color: var(--sc-ink);
  margin-block: 1.5rem 2.5rem;
}
.subtitle-speed [hidden] { display: none !important; }
.subtitle-speed ::selection { color: var(--sc-ink); background: #cce8df; }
.subtitle-speed .sc-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}
.subtitle-speed .sc-panel {
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--sc-line);
  border-radius: 0.85rem;
  background: #fff;
}
.subtitle-speed .sc-output { background: var(--sc-soft); }
.subtitle-speed .sc-form { display: grid; gap: 1rem; }
.subtitle-speed .sc-heading,
.subtitle-speed .sc-flag-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
}
.subtitle-speed h2 { margin: 0; color: var(--sc-ink); font: inherit; font-size: 1.05rem; font-weight: 700; }
.subtitle-speed label { display: block; font-size: 0.9rem; font-weight: 650; }
.subtitle-speed :is(textarea, input[type="number"]) {
  display: block;
  min-width: 0;
  max-width: 100%;
  margin-block-start: 0.35rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--sc-field);
  border-radius: 0.5rem;
  background: #fff;
  color: var(--sc-ink);
  line-height: 1.5;
}
.subtitle-speed textarea { width: 100%; resize: vertical; font-family: ui-monospace, monospace; font-size: 0.875rem; caret-color: var(--sc-action); }
.subtitle-speed textarea::placeholder { color: var(--sc-muted); }
.subtitle-speed input[type="number"] { width: 6.5rem; min-height: 2.7rem; font-variant-numeric: tabular-nums; }
.subtitle-speed .sc-file { position: relative; width: fit-content; }
.subtitle-speed .sc-file input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.subtitle-speed .sc-file label {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--sc-field);
  border-radius: 0.5rem;
  color: var(--sc-action);
  background: #fff;
  font-size: 0.875rem;
}
.subtitle-speed .sc-file:hover label { background: var(--sc-soft); }
.subtitle-speed .sc-file input:focus-visible + label,
.subtitle-speed :is(input, textarea, button):focus-visible { outline: 2px solid var(--sc-action); outline-offset: 3px; }
.subtitle-speed [aria-invalid="true"], .subtitle-speed .sc-file input[aria-invalid="true"] + label { border-color: #a2281d; }
.subtitle-speed .sc-note { margin: 0.45rem 0 0; color: var(--sc-muted); font-size: 0.85rem; line-height: 1.55; }
.subtitle-speed .sc-summary { margin-block: 0.65rem 0.75rem; }
.subtitle-speed .sc-status:empty { margin: 0; }
.subtitle-speed .sc-error { margin: 0; color: #a2281d; font-size: 0.9rem; line-height: 1.5; }
.subtitle-speed button { cursor: pointer; font: inherit; font-weight: 650; }
.subtitle-speed .sc-sample {
  padding: 0.2rem 0;
  border: 0;
  background: transparent;
  color: var(--sc-action);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.subtitle-speed .sc-action {
  justify-self: start;
  min-height: 2.75rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--sc-action);
  border-radius: 0.5rem;
  color: #fff;
  background: var(--sc-action);
}
.subtitle-speed .sc-action:hover:not(:disabled) { background: #114736; }
.subtitle-speed .sc-action:disabled { cursor: default; border-color: var(--sc-line); color: var(--sc-muted); background: var(--sc-soft); }
.subtitle-speed .sc-output .sc-action { margin-block-start: 0.875rem; }
.subtitle-speed .sc-flag-list { padding: 0; margin: 0; border-block-start: 1px solid var(--sc-line); }
.subtitle-speed .sc-flag-list li { list-style: none; padding-block: 0.75rem; border-block-end: 1px solid var(--sc-line); overflow-wrap: anywhere; }
.subtitle-speed .sc-flag-heading { font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.subtitle-speed .sc-flag-heading span { color: #8d3027; font-weight: 700; }
.subtitle-speed .sc-timing { font-variant-numeric: tabular-nums; }
.subtitle-speed .sc-text { margin: 0.45rem 0 0; font-size: 0.9rem; line-height: 1.5; }

@media (min-width: 740px) {
  .subtitle-speed .sc-workspace { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 440px) {
  .subtitle-speed .sc-action { width: 100%; }
  .subtitle-speed :is(textarea, input[type="number"]) { font-size: 1rem; }
}
