* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #fff;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem 3rem;
}

.title {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0 0 0.5rem;
}

.refresh-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.refresh-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  background: #9ca3af;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.refresh-btn:hover {
  background: #6b7280;
}

.refresh-btn:focus {
  outline: 2px solid #6b7280;
  outline-offset: 2px;
}

.refresh-status {
  font-size: 0.875rem;
  color: #059669;
}

.tabs {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #e5e7eb;
}

.tab {
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  font-family: inherit;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.tab:hover {
  color: #374151;
}

.tab.active {
  color: #111827;
  border-bottom-color: #374151;
}

.tab:focus {
  outline: 2px solid #6b7280;
  outline-offset: 2px;
}

.tab-panels {
  width: 100%;
  max-width: 480px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.text-section {
  width: 100%;
  margin-bottom: 1.5rem;
}

.text-entry {
  width: 100%;
  min-height: 200px;
  padding: 1rem;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  color: #333;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  resize: vertical;
  overflow-y: auto;
}

.text-entry::placeholder {
  color: #9ca3af;
}

.text-entry:focus {
  outline: 2px solid #6b7280;
  outline-offset: 0;
}

.record-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
}

.record-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c00;
  margin-bottom: 0.75rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.record-indicator.active {
  opacity: 1;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.record-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.record-btn:hover {
  background: #6b7280;
}

.record-btn:focus {
  outline: 2px solid #6b7280;
  outline-offset: 2px;
}

.record-btn-icon {
  position: absolute;
  display: none;
}

.record-btn-icon.visible {
  display: block;
}

.record-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
}

.pause-icon {
  width: 26px;
  height: 24px;
  position: relative;
}

.pause-icon::before,
.pause-icon::after {
  content: "";
  position: absolute;
  top: 0;
  width: 8px;
  height: 24px;
  background: #fff;
  border-radius: 2px;
}

.pause-icon::before {
  left: 0;
}

.pause-icon::after {
  right: 0;
}

.listening-label {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: #6b7280;
  opacity: 0;
  transition: opacity 0.2s;
}

.listening-label.visible {
  opacity: 1;
}

.send-section {
  margin-bottom: 1.5rem;
}

.send-btn {
  padding: 0.6rem 1.75rem;
  font-size: 1rem;
  font-family: inherit;
  background: #9ca3af;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.send-btn:hover:not(:disabled) {
  background: #6b7280;
}

.send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.send-btn:focus {
  outline: 2px solid #6b7280;
  outline-offset: 2px;
}

.output-section {
  width: 100%;
  max-width: 480px;
  min-height: 120px;
}

.output {
  margin: 0;
  padding: 1rem;
  font-size: 0.8125rem;
  color: #374151;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow-y: auto;
}
