* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.container {
  width: 100%;
  max-width: 700px;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.8rem;
  color: #111;
  margin-bottom: 0.4rem;
}

.subtitle {
  color: #666;
  font-size: 0.95rem;
}

.input-group {
  display: flex;
  gap: 0.5rem;
}

#url-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

#url-input:focus {
  border-color: #2563eb;
}

#fetch-btn {
  padding: 0.75rem 1.5rem;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

#fetch-btn:hover {
  background: #1d4ed8;
}

#fetch-btn:disabled {
  background: #93b4f5;
  cursor: not-allowed;
}

.error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  border-radius: 4px;
  color: #b91c1c;
  font-size: 0.9rem;
}

.loading {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #666;
  font-size: 0.95rem;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #ddd;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.result {
  margin-top: 1.5rem;
  background: white;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
}

.result-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

#copy-btn {
  padding: 0.4rem 1rem;
  background: #111;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

#copy-btn:hover {
  background: #333;
}

#copy-btn.copied {
  background: #16a34a;
}

.transcript-text {
  padding: 1rem;
  max-height: 60vh;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

footer {
  margin-top: 2rem;
  text-align: center;
  color: #999;
  font-size: 0.85rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 500px) {
  .input-group {
    flex-direction: column;
  }

  #fetch-btn {
    width: 100%;
  }

  header h1 {
    font-size: 1.5rem;
  }
}
