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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e5e7eb;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  background: radial-gradient(circle at top left, #22c55e 0, #0f172a 45%, #020617 100%);
  border-bottom: 1px solid #1f2937;
  padding: 1.5rem 0 1.75rem;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

h1 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 0.2rem;
  letter-spacing: 0.02em;
}

.tagline {
  margin: 0;
  color: #cbd5f5;
  max-width: 40rem;
  font-size: 0.95rem;
}

.badge {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.5);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.header-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}

.header-sliders {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem 0.8rem;
}

.speed-control {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #d1d5db;
}

.speed-control label {
  font-weight: 500;
}

.speed-control input[type="range"] {
  accent-color: #22c55e;
}

.speed-value {
  font-variant-numeric: tabular-nums;
  color: #a5b4fc;
}

.voice-control {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #d1d5db;
}

.voice-control label {
  font-weight: 500;
}

.voice-control select {
  background: #020617;
  color: #e5e7eb;
  border-radius: 999px;
  border: 1px solid #1f2937;
  padding: 0.15rem 0.65rem;
  font-size: 0.8rem;
}

.voice-control select:focus {
  outline: none;
  border-color: #22c55e;
}

.intro {
  margin: 1.75rem 0 1rem;
  font-size: 0.98rem;
  color: #e5e7eb;
}

.note {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

.topics {
  margin: 1.5rem 0 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.topic {
  background: #020617;
  border-radius: 0.75rem;
  border: 1px solid #1f2937;
  overflow: hidden;
}

.topic-header {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
}

.topic-header:hover {
  background: #02081a;
}

.topic-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.topic-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: #111827;
  color: #9ca3af;
  font-size: 0.8rem;
}

.topic-title {
  font-size: 1.372rem;
  font-weight: 600;
}

.topic-count {
  font-size: 0.78rem;
  color: #9ca3af;
}

.chevron {
  font-size: 0.9rem;
  transition: transform 0.16s ease-out;
}

.chevron.open {
  transform: rotate(90deg);
}

.topic-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
  border-top: 1px solid #111827;
}

.topic-body-inner {
  padding: 0.6rem 1rem 0.75rem;
}

.phrase-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed #1f2937;
}

.phrase-row:last-child {
  border-bottom: none;
}

.phrase-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.phrase-spanish {
  font-size: 1.4rem;
  font-weight: 500;
}

.phrase-english {
  font-size: 1.204rem;
  color: #9ca3af;
}

.speak-btn {
  align-self: center;
  border-radius: 999px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  padding: 0.3rem 0.75rem;
  font-size: 1.12rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

.speak-btn:hover {
  background: #02081a;
  border-color: #22c55e;
  color: #bbf7d0;
}

.speak-btn-icon {
  font-size: 1.26rem;
}

.speak-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.site-footer {
  border-top: 1px solid #1f2937;
  padding: 1.2rem 0 1.6rem;
  font-size: 0.8rem;
  color: #6b7280;
  background: #020617;
}

@media (max-width: 600px) {
  .header-controls {
    align-items: flex-start;
  }

  .header-sliders {
    justify-content: flex-start;
  }

  .phrase-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .speak-btn {
    justify-self: flex-start;
  }
}


