body.tool-page {
  max-width: 880px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

#tts-text {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 10rem;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem 1.25rem;
}

.field select,
.field input[type="range"],
.field input.text-input {
  width: 100%;
}

.field input.text-input {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.voice-hint {
  margin: 0.35rem 0 0;
  min-height: 1.1em;
  font-style: italic;
}

.output-options {
  margin-bottom: 1rem;
}

.field select {
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
}

.radio-row {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  padding-top: 0.25rem;
}

.radio-row label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
}

.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

#player {
  width: 100%;
  margin-bottom: 0.75rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.muted-sm { color: var(--muted); font-size: 0.8rem; }

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.recent-list li:last-child { border-bottom: none; }

.recent-list a { font-weight: 600; }

code {
  font-size: 0.85rem;
  color: var(--accent);
}

.update-panel .update-toolbar {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.update-status {
  margin: 0;
}

.update-row {
  font-size: 0.85rem;
  margin: 0.35rem 0;
}

.update-row.update-available strong {
  color: var(--accent);
}

.update-badge {
  margin: 0.75rem 0 0;
  color: var(--success);
  font-size: 0.85rem;
  font-weight: 600;
}

#job-message {
  white-space: pre-wrap;
  flex: 1;
  min-width: 200px;
}

.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mode-tab {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}

.mode-tab:hover { border-color: var(--accent); color: var(--text); }

.mode-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.mode-panel {
  padding: 0.75rem 1rem;
}

#conv-text,
#pause-text,
#conv-speaker-count {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

#conv-text,
#pause-text {
  line-height: 1.5;
  resize: vertical;
  min-height: 10rem;
}

#conv-speaker-count {
  max-width: 6rem;
}

.conv-speakers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem 1rem;
}

.conv-speaker-row select {
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
}

.conv-preview {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.55;
}

.conv-preview li {
  margin-bottom: 0.35rem;
}

.conv-speaker-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-muted);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-right: 0.35rem;
}

.conv-options {
  margin-bottom: 1rem;
}
