:root {
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #ef4444;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  color: var(--text-main);
  padding: 30px 16px;
  display: flex;
  justify-content: center;
}

.app-shell {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  padding: 0 8px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 26px;
  height: 26px;
  color: #38bdf8;
}

.badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #e2e8f0;
}

.main-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.headline-group h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.headline-group p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.controls-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--surface-alt);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.field-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.field-item label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 0.92rem;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.record-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 0 16px;
  gap: 12px;
}

.mic-button {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: #3b82f6;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.mic-button:hover {
  transform: scale(1.05);
  background: var(--primary-hover);
}

.mic-svg {
  width: 36px;
  height: 36px;
  position: relative;
  z-index: 2;
}

.pulse-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid transparent;
  pointer-events: none;
}

.recording .mic-button {
  background: var(--danger);
  animation: pulse-border 1.5s infinite;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.45);
}

@keyframes pulse-border {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { transform: scale(1.06); box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.timer {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.recording .timer {
  color: var(--danger);
}

.status-indicator {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.result-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.result-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.count-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-secondary {
  background: #0f172a;
  color: #fff;
}

.btn-secondary:hover {
  background: #334155;
}

.btn-outline {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-outline:hover {
  background: var(--surface-alt);
  color: var(--text-main);
}

textarea {
  width: 100%;
  height: 220px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  color: var(--text-main);
}

textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.app-footer {
  text-align: center;
  font-size: 0.8rem;
  color: #94a3b8;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.25s ease;
  pointer-events: none;
  box-shadow: var(--shadow);
  z-index: 99;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}
