.speech-script-tools {
  margin-block: 12px;
  color: var(--text);
}
.speech-script-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.speech-script-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  flex: 0 1 250px;
}
.speech-script-toolbar label > span:first-child { white-space: nowrap; flex-shrink: 0; }
.speech-script-toolbar .custom-select-shell { width: 0; min-width: 0; flex: 1 1 0; }
.speech-script-toolbar select {
  min-height: 36px;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 6px 28px 6px 10px;
}
.speech-script-summary {
  min-height: 20px;
  margin-top: 8px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.speech-script-summary[data-state="success"] { color: var(--ok); }
.speech-script-summary[data-state="warning"] { color: var(--warn); }
.speech-script-summary[data-state="error"] { color: var(--danger); }
.speech-script-preview {
  max-height: 280px;
  overflow: auto;
  margin-top: 8px;
  border-block: 1px solid var(--line);
}
.speech-script-preview table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.speech-script-preview caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.speech-script-preview th, .speech-script-preview td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.speech-script-preview th {
  position: sticky;
  top: 0;
  background: var(--panel-soft);
  font-weight: 600;
}
.speech-script-preview th:nth-child(1) { width: 54px; }
.speech-script-preview th:nth-child(2) { width: 210px; }
.speech-script-preview th:nth-child(4) { width: 210px; }
.speech-script-preview tr[data-warning="true"] td:last-child { color: var(--warn); }
.speech-script-tools :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 700px) {
  .speech-script-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .speech-script-toolbar label { grid-column: 1 / -1; grid-row: 1; flex-wrap: wrap; }
  .speech-script-toolbar button { width: 100%; min-width: 0; white-space: normal; }
  .speech-script-preview thead { display: none; }
  .speech-script-preview tbody { display: block; }
  .speech-script-preview tr { display: grid; grid-template-columns: 28px minmax(0, 1fr); border-bottom: 1px solid var(--line); padding: 8px 0; }
  .speech-script-preview td { padding: 3px 4px; border: 0; font-size: 12px; }
  .speech-script-preview td:nth-child(3) { grid-column: 1 / -1; font-size: 13px; }
  .speech-script-preview td:nth-child(4) { grid-column: 2; color: var(--muted); }
}