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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0f4f0;
  color: #1a2e1a;
  min-height: 100vh;
}

header {
  background: #2d6a2d;
  color: #fff;
  padding: 1.5rem 1rem;
  text-align: center;
}

header h1 { font-size: 2rem; font-weight: 700; }
header .subtitle { opacity: 0.85; margin-top: 0.25rem; font-size: 0.95rem; }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* Controls */
.controls { text-align: center; margin-bottom: 2rem; }

.btn-record {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
  background: #2d6a2d;
  color: #fff;
  transition: background 0.2s, transform 0.1s;
}

.btn-record:hover { background: #245424; }
.btn-record:active { transform: scale(0.97); }
.btn-record.listening { background: #b33; }
.btn-record.listening:hover { background: #922; }

.status {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #555;
  min-height: 1.2em;
}

.status.active { color: #2d6a2d; font-weight: 500; }
.status.error { color: #b33; }

/* Results */
.results-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.count {
  font-size: 0.85rem;
  font-weight: 400;
  color: #666;
}

.empty {
  color: #888;
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem 0;
}

.results-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }

.result-card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.result-card .common-name {
  font-size: 1rem;
  font-weight: 600;
}

.result-card .scientific-name {
  font-size: 0.8rem;
  font-style: italic;
  color: #666;
  margin-top: 0.1rem;
}

.result-card .confidence-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.confidence-bar-bg {
  flex: 1;
  height: 6px;
  background: #e0e8e0;
  border-radius: 3px;
  overflow: hidden;
}

.confidence-bar {
  height: 100%;
  background: #2d6a2d;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.confidence-pct {
  font-size: 0.85rem;
  font-weight: 600;
  color: #2d6a2d;
  min-width: 3rem;
  text-align: right;
}

.result-card .meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #888;
}

.result-card a {
  color: #2d6a2d;
  text-decoration: none;
  font-weight: 500;
}

.result-card a:hover { text-decoration: underline; }
