:root {
  color-scheme: light;
  font-family: ui-rounded, "Avenir Next", Avenir, "Segoe UI", sans-serif;
  background: #f4f2eb;
  color: #1f2a25;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at 50% -15%, #d9e4d7 0, transparent 34rem), #f4f2eb;
}

button, input { font: inherit; }

button { cursor: pointer; }

button:focus-visible, input:focus-visible {
  outline: 3px solid #de8546;
  outline-offset: 3px;
}

.app-shell {
  width: min(100%, 42rem);
  margin: 0 auto;
  padding: 2.25rem 1rem 3rem;
}

.hero { padding: 0 0.5rem 1.5rem; text-align: center; }

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 0.55rem;
  color: #234236;
  font-size: clamp(2.25rem, 10vw, 3.4rem);
  letter-spacing: -0.05em;
  line-height: 1;
}

h2 { margin-bottom: 0.4rem; font-size: 1.55rem; letter-spacing: -0.025em; }

.eyebrow, .section-label {
  margin-bottom: 0.3rem;
  color: #5a7063;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.intro { margin: 0 auto; max-width: 33rem; color: #516158; line-height: 1.48; }

.reference-card, .microphone-card, .tuner-card, .safety-card {
  margin-bottom: 1rem;
  border: 1px solid #d9ded5;
  border-radius: 1.25rem;
  background: rgba(255, 255, 252, 0.88);
  box-shadow: 0 0.4rem 1.2rem rgba(38, 55, 45, 0.06);
}

.reference-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
}

.reference-card strong { color: #234236; font-size: 1.25rem; }

.reference-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #506056;
  font-weight: 700;
}

.reference-control input {
  width: 5.2rem;
  min-height: 2.65rem;
  border: 1px solid #bdcabc;
  border-radius: 0.7rem;
  background: #fff;
  color: #1f2a25;
  font-weight: 750;
  text-align: center;
}

.microphone-card { padding: 1rem 1.15rem; text-align: center; }

.primary-button, .secondary-button, .text-button, .choice-button, .quint-link {
  min-height: 2.9rem;
  border-radius: 0.82rem;
  font-weight: 750;
}

.primary-button {
  border: 1px solid #234236;
  background: #234236;
  color: #fff;
  padding: 0.65rem 1.05rem;
}

.primary-button:hover { background: #173126; }
.primary-button.compact { padding-inline: 0.85rem; }

.secondary-button {
  border: 1px solid #78907e;
  background: #fff;
  color: #234236;
  padding: 0.65rem 1rem;
}

.text-button, .quint-link {
  border: 0;
  background: transparent;
  color: #315945;
  padding: 0.65rem 0.6rem;
}

.text-button:disabled { color: #9aa59d; cursor: not-allowed; }
.quint-link { display: block; margin: 0.55rem auto 0; text-decoration: underline; }

.tuner-card { padding: 1.35rem 1.15rem; }
.step-heading p:not(.section-label) { margin-bottom: 1.25rem; color: #536159; line-height: 1.45; }

.pitch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid #dce3da;
  border-radius: 0.9rem;
  background: #f8faf6;
}

.pitch-grid > div { padding: 0.9rem; }
.pitch-grid > div + div { border-left: 1px solid #dce3da; }
.pitch-grid strong { display: block; min-height: 1.4em; color: #244937; font-size: clamp(1rem, 4vw, 1.25rem); }

.meter { margin: 2.1rem 0 1rem; }
.meter-label { position: absolute; top: -1.35rem; color: #65746a; font-size: 0.73rem; font-weight: 700; }
.meter-label-left { left: 0; }
.meter-label-centre { left: 50%; color: #3a7252; transform: translateX(-50%); }
.meter-label-right { right: 0; }

.meter-track {
  position: relative;
  height: 1.35rem;
  border-radius: 99px;
  background: linear-gradient(90deg, #e2c3ae 0%, #f6ead6 30%, #d2e6d5 46%, #d2e6d5 54%, #f6ead6 70%, #e2c3ae 100%);
}

.tuned-zone { position: absolute; top: 0.15rem; bottom: 0.15rem; left: 48.25%; width: 3.5%; border-radius: 99px; background: #76ad80; }
.centre-line { position: absolute; top: -0.25rem; bottom: -0.25rem; left: 50%; width: 2px; background: #315945; }
.needle { position: absolute; top: -0.44rem; bottom: -0.44rem; width: 0.32rem; border-radius: 99px; background: #19281f; box-shadow: 0 0.1rem 0.25rem rgba(0, 0, 0, 0.25); transform: translateX(-50%); transition: left 90ms linear; }
.needle[data-active="false"] { opacity: 0.35; }

.cent-reading { margin: 0.4rem 0 0.8rem; color: #234236; font-size: 1.65rem; font-weight: 800; text-align: center; }

.status { margin: 0.65rem 0 0; border-radius: 0.7rem; padding: 0.7rem 0.8rem; font-size: 0.94rem; line-height: 1.4; }
.waiting { background: #edf0ea; color: #5c695f; }
.ready { background: #e2eee2; color: #315945; }
.good { background: #d7eddc; color: #1f633a; }
.low { background: #fbefd7; color: #80542a; }
.high { background: #f8e1dc; color: #8e3c31; }
.error { background: #f7dfdc; color: #8e332b; }

.button-row { display: flex; align-items: center; justify-content: space-between; gap: 0.45rem; margin-top: 1.2rem; }
.button-row .text-button { margin-left: auto; }

.choice-row { display: flex; gap: 0.5rem; margin: 0 0 0.9rem; }
.choice-button { flex: 1; border: 1px solid #bdcabc; background: #fff; color: #315945; }
.choice-button.selected { border-color: #234236; background: #e1ece2; color: #1d442e; }
.targets { margin: 0 0 1.1rem; color: #596b5f; font-size: 0.9rem; }

.quint-results { display: grid; grid-template-columns: 1fr 1fr; margin: 0; overflow: hidden; border: 1px solid #dce3da; border-radius: 0.9rem; background: #f8faf6; }
.quint-results div { padding: 0.8rem; }
.quint-results div:nth-child(odd) { border-right: 1px solid #dce3da; }
.quint-results div:nth-child(-n + 2) { border-bottom: 1px solid #dce3da; }
.quint-results dt { color: #64756a; font-size: 0.76rem; font-weight: 700; }
.quint-results dd { margin: 0.25rem 0 0; color: #234236; font-weight: 800; }

.safety-card { padding: 1.2rem 1.15rem; background: #fcf7ed; }
.safety-card h2 { color: #724b2c; font-size: 1.22rem; }
.safety-card ul { margin: 0; padding-left: 1.15rem; color: #624e3c; line-height: 1.48; }
.safety-card li + li { margin-top: 0.35rem; }

.privacy-note { margin: 1.4rem auto 0; max-width: 33rem; color: #657168; font-size: 0.84rem; line-height: 1.45; text-align: center; }

@media (max-width: 390px) {
  .app-shell { padding-inline: 0.75rem; }
  .reference-card { align-items: flex-start; flex-direction: column; }
  .reference-control { width: 100%; justify-content: flex-end; }
  .button-row { flex-wrap: wrap; }
  .button-row .primary-button { flex: 1; }
}
