.tuner {
  padding-bottom: 3rem;
}

.tuner .kicker {
  margin: 2.5rem 0 0.5rem;
  color: var(--moss);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.tuner h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 560;
}

.lede {
  max-width: 38rem;
  color: var(--ink-soft);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.2rem 0 0;
}

.chip {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.chip:hover,
.chip.is-on {
  border-color: var(--ink);
  color: var(--ink);
}

.chip.is-on {
  background: var(--ink);
  color: var(--paper);
}

.instrument-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.4rem;
  margin-top: 0.35rem;
}

.tuning-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tuning-label select {
  min-width: 16rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0;
}

.tuner-panel {
  margin: 2rem 0;
  padding: 1.6rem;
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  text-align: center;
}

.note-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 10vw, 6rem);
  line-height: 1;
}

.freq {
  margin: 0.4rem 0 1.4rem;
  color: var(--ink-soft);
}

.meter-track {
  position: relative;
  height: 8px;
  margin: 0 auto;
  max-width: 28rem;
  background: linear-gradient(90deg, #9c3b24 0%, #3f5d4a 50%, #9c3b24 100%);
}

.needle {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 3px;
  height: 24px;
  background: var(--ink);
  transform: translateX(-50%);
  transition: left 80ms linear;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  max-width: 28rem;
  margin: 0.7rem auto 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.cents {
  min-height: 1.4em;
  margin: 0.4rem 0 1.2rem;
  color: var(--moss);
}

.headstock-wrap {
  margin: -0.5rem 0 1.6rem;
}

.headstock {
  --rows: 3;
  display: grid;
  grid-template-columns: 4.2rem minmax(4.8rem, 7.5rem) 4.2rem;
  justify-content: center;
  gap: 0.35rem 0.55rem;
  min-height: 15.5rem;
}

.pegs {
  position: relative;
  height: 100%;
}

.peg {
  position: absolute;
  left: 50%;
  width: 3.35rem;
  height: 3.35rem;
  padding: 0;
  border: 2px solid var(--rule);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 0 rgba(28, 23, 18, 0.06);
}

.peg small {
  display: block;
  margin-top: 0.12rem;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 0.62rem;
}

.peg.is-active {
  border-color: var(--ink);
}

.peg.is-in-tune {
  border-color: var(--moss);
  color: var(--moss);
  box-shadow: 0 0 0 3px rgba(63, 93, 74, 0.18);
}

.peg.is-in-tune small {
  color: var(--moss);
}

.peg.is-off {
  border-color: var(--accent);
  color: var(--accent);
}

.peg.is-locked {
  outline: 1px dashed var(--ink-soft);
  outline-offset: 3px;
}

.head-body {
  position: relative;
  border: 1px solid #cbbca6;
  border-radius: 18% 18% 6px 6px;
  background:
    linear-gradient(180deg, #efe3d0 0%, #ddcdb4 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 253, 248, 0.35);
}

.head-strings {
  position: absolute;
  inset: 10% 24% 9%;
  display: flex;
  justify-content: space-between;
}

.head-strings span {
  width: 1.5px;
  background: #7a6b58;
  opacity: 0.55;
}

.head-strings span.is-active {
  opacity: 1;
  background: var(--moss);
}

.head-strings span.is-off {
  opacity: 1;
  background: var(--accent);
}

.nut {
  position: absolute;
  right: 8%;
  bottom: 0;
  left: 8%;
  height: 9px;
  background: #cfc4b0;
  border-radius: 2px 2px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.head-hint {
  margin: 0.85rem 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.strings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.strings button,
.strings span {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.92rem;
}

.strings button {
  cursor: pointer;
}

.strings button.is-active,
.strings button.is-in-tune,
.strings button.is-off {
  color: var(--ink);
}

.strings button.is-active {
  border-color: var(--ink);
}

.strings button.is-in-tune {
  border-color: var(--moss);
  color: var(--moss);
}

.strings button.is-off {
  border-color: var(--accent);
  color: var(--accent);
}

.strings button.is-locked {
  background: var(--card);
}

@media (max-width: 520px) {
  .headstock {
    grid-template-columns: 3.6rem minmax(3.6rem, 1fr) 3.6rem;
    min-height: 14rem;
  }

  .peg {
    width: 2.9rem;
    height: 2.9rem;
    font-size: 0.92rem;
  }

  .tuning-label select {
    min-width: 100%;
  }
}
