/* Shared, responsive tuner controls; colors and buttons otherwise inherit main.css. */
#ix-tuner .tuner-fields { align-items: end; }
#ix-tuner .tuner-hero {
  padding: 1rem;
  border: 1px solid rgba(127, 127, 127, .24);
  border-radius: .75rem;
  text-align: center;
}
#ix-tuner .tuner-hero .tuner-hero-label { margin: 0 0 .4rem; opacity: .72; font-size: .9rem; }
#ix-tuner .tuner-target { font-size: clamp(1.3rem, 4vw, 2rem); font-weight: 700; overflow-wrap: anywhere; }
#ix-tuner .tuner-readings { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem 2rem; margin-top: .85rem; }
#ix-tuner .tuner-readings p { margin: 0; font-variant-numeric: tabular-nums; }
#ix-tuner .tuner-readings strong { font-weight: 650; }
#ix-tuner .tuner-verdict {
  margin: .85rem 0 .3rem;
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  font-weight: 750;
}
#ix-tuner .tuner-readings strong { font-size: 1.12rem; }
#ix-tuner .tuner-meter {
  position: relative;
  height: 2.3rem;
  margin: .65rem .25rem .3rem;
  border-radius: .45rem;
  border: 1px solid rgba(127, 127, 127, .38);
  background: linear-gradient(to right,
    rgba(55, 132, 196, .27) 0%, rgba(55, 132, 196, .15) 44%,
    rgba(41, 162, 91, .27) 45%, rgba(41, 162, 91, .27) 55%,
    rgba(230, 143, 49, .15) 56%, rgba(230, 143, 49, .27) 100%);
}
#ix-tuner .tuner-meter-acceptable {
  position: absolute;
  left: 45%;
  width: 10%;
  top: 0;
  bottom: 0;
  border-inline: 1px solid rgba(22, 137, 75, .5);
}
#ix-tuner .tuner-meter-center {
  position: absolute;
  z-index: 1;
  top: -.45rem;
  bottom: -.45rem;
  left: 50%;
  border-left: 2px dashed currentColor;
  opacity: .75;
}
#ix-tuner #tuner-needle {
  position: absolute;
  z-index: 2;
  top: -.4rem;
  bottom: -.4rem;
  left: 50%;
  width: 5px;
  border-radius: 3px;
  transform: translateX(-50%);
  background: var(--accent-button, #2563eb);
  box-shadow: 0 0 0 2px rgba(127, 127, 127, .28);
  transition: left 120ms linear;
}
#ix-tuner .tuner-meter[data-state="matched"] #tuner-needle {
  background: #198754;
}
#ix-tuner .tuner-scale { display: flex; justify-content: space-between; margin-top: .3rem; font-size: .75rem; opacity: .7; }
#ix-tuner .tuner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
#ix-tuner .tuner-actions .btn { min-height: 2.6rem; }
#ix-tuner #tuner-status { margin: .6rem 0 0; min-height: 1.5em; }
#ix-tuner .tuner-hint { margin: 0; opacity: .75; font-size: .9rem; }

#ix-tuner .tuner-quick {
  border: 1px solid rgba(127, 127, 127, .24);
  border-radius: .75rem;
  padding: .85rem;
}
#ix-tuner .tuner-quick-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem;
  margin-bottom: .75rem;
}
#ix-tuner .tuner-quick-header h3 {
  font-size: 1rem;
  margin: 0;
}
#ix-tuner .tuner-octave-field { min-width: 9rem; }
#ix-tuner .tuner-octave-field .label { font-size: .85rem; }
#ix-tuner .tuner-quick-grid {
  display: grid;
  gap: .45rem;
}
/* The string pads resemble a fretboard: wood, frets, tuning pegs and wire. */
#ix-tuner .tuner-quick-grid--strings {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: .45rem .65rem;
  border-radius: .65rem;
  border: 1px solid #70533b;
  background:
    repeating-linear-gradient(90deg, transparent 0 68px, rgba(245, 218, 170, .22) 69px 71px, transparent 72px 108px),
    linear-gradient(90deg, #352923, #73503a 15%, #604634 56%, #3b3028);
  box-shadow: inset 0 2px 9px rgba(0,0,0,.3);
}
#ix-tuner .tuner-string {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 3.25rem;
  width: 100%;
  padding: .4rem .45rem;
  border: 0;
  border-radius: .35rem;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
#ix-tuner .tuner-string + .tuner-string {
  border-top: 1px solid rgba(255,255,255,.06);
}
#ix-tuner .tuner-string::before {
  content: '';
  position: absolute;
  z-index: 1;
  left: .55rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  transform: translateY(-50%);
  border: 3px solid #bdc5c9;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f9fafb, #5d6671 78%);
  box-shadow: 0 1px 3px #151515;
}
#ix-tuner .tuner-string::after {
  content: '';
  position: absolute;
  left: 2.3rem;
  right: 1.1rem;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(#f1f0df, #a0a9ad 55%, #f5ebd0);
  box-shadow: 0 1px 2px rgba(0,0,0,.85);
  pointer-events: none;
}
#ix-tuner .tuner-string[data-short="true"]::after { left: 15%; }
#ix-tuner .tuner-string[data-gauge="1"]::after { height: 1px; }
#ix-tuner .tuner-string[data-gauge="2"]::after { height: 1.5px; }
#ix-tuner .tuner-string[data-gauge="3"]::after { height: 2px; }
#ix-tuner .tuner-string[data-gauge="4"]::after { height: 2.5px; }
#ix-tuner .tuner-string[data-gauge="5"]::after { height: 3px; }
#ix-tuner .tuner-string[data-gauge="6"]::after { height: 3.5px; }
#ix-tuner .tuner-string[data-gauge="7"]::after { height: 4px; }
#ix-tuner .tuner-string-label,
#ix-tuner .tuner-string-action {
  position: relative;
  z-index: 2;
  display: inline-block;
  border-radius: .32rem;
  background: rgba(25, 23, 22, .85);
  color: #fff;
}
#ix-tuner .tuner-string-label {
  margin-left: 2.45rem;
  padding: .25rem .5rem;
  font-size: .92rem;
}
#ix-tuner .tuner-string-action {
  margin-right: .35rem;
  padding: .2rem .45rem;
  font-size: 1rem;
}
#ix-tuner .tuner-string:hover,
#ix-tuner .tuner-string:focus-visible,
#ix-tuner .tuner-string.is-selected {
  background: rgba(255, 244, 222, .14);
}
#ix-tuner .tuner-string.is-selected::after {
  background: #ffe6a2;
  box-shadow: 0 0 7px #ffd16a, 0 1px 2px rgba(0,0,0,.8);
}
#ix-tuner .tuner-string.is-selected .tuner-string-label {
  outline: 1px solid #ffe6a2;
}
#ix-tuner .tuner-string:focus-visible {
  outline: 2px solid #ffe6a2;
  outline-offset: -2px;
}
#ix-tuner .tuner-quick-grid--keys {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr));
}
#ix-tuner .tuner-quick-note {
  width: 100%;
  padding: .6rem .8rem;
  min-height: 2.75rem;
  text-align: center;
  font: inherit;
  border: 1px solid rgba(127, 127, 127, .4);
  border-radius: .45rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
#ix-tuner .tuner-quick-note--sharp {
  background: rgba(127, 127, 127, .16);
}
#ix-tuner .tuner-quick-note:hover {
  border-color: var(--accent-button, #2563eb);
}
#ix-tuner .tuner-quick-note.is-selected {
  border: 2px solid var(--accent-button, #2563eb);
  font-weight: 800;
  padding: calc(.6rem - 1px) calc(.8rem - 1px);
}
#ix-tuner .tuner-quick-note:focus-visible {
  outline: 3px solid var(--accent-button, #2563eb);
  outline-offset: 2px;
}


/* Piano: one real octave, white keys below the raised black keys. */
#ix-tuner .tuner-quick-grid--piano {
  display: block;
  position: relative;
  width: 100%;
  max-width: 660px;
  height: clamp(8rem, 28vw, 12rem);
  margin-inline: auto;
}
#ix-tuner .tuner-piano-key {
  position: absolute;
  top: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 .6rem;
  font: inherit;
  font-size: clamp(.67rem, 2.4vw, .88rem);
  font-weight: 650;
  border-radius: 0 0 .35rem .35rem;
  cursor: pointer;
  touch-action: manipulation;
}
#ix-tuner .tuner-piano-key--white {
  z-index: 1;
  width: calc(100% / 7);
  height: 100%;
  border: 1px solid #777;
  background: #fafafa;
  color: #252525;
}
#ix-tuner .tuner-piano-key--black {
  z-index: 2;
  width: 8.7%;
  height: 62%;
  padding-bottom: .48rem;
  border: 1px solid #444;
  background: #1b1c1d;
  color: #fff;
}
#ix-tuner .tuner-piano-key--white.is-selected {
  background: #bcdefb;
  outline: 3px solid #176ba8;
  outline-offset: -3px;
}
#ix-tuner .tuner-piano-key--black.is-selected {
  background: #1668a6;
  border-color: #0f4e7c;
}
#ix-tuner .tuner-piano-key:hover:not(:disabled) {
  filter: brightness(.91);
}
#ix-tuner .tuner-piano-key:focus-visible {
  outline: 3px solid #1c8eda;
  outline-offset: 1px;
}
#ix-tuner .tuner-piano-key:disabled {
  opacity: .37;
  cursor: not-allowed;
}


/* Twelve-string guitar: each course has a primary and companion string. */
#ix-tuner .tuner-quick-grid--courses .tuner-string[data-member="1"] {
  background: rgba(0, 0, 0, .16);
}
#ix-tuner .tuner-quick-grid--courses .tuner-string[data-member="1"]:not(:last-child) {
  border-bottom: 2px solid rgba(244, 220, 183, .45);
}
#ix-tuner .tuner-quick-grid--courses .tuner-string[data-member="1"]::after {
  background: linear-gradient(#fff9dd, #bba875);
}
#ix-tuner[data-instrument="harp"] .tuner-quick-grid--strings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#ix-tuner[data-instrument="harp"] .tuner-string {
  min-height: 2.95rem;
}
#ix-tuner[data-instrument="harp"] .tuner-string-label { font-size: .82rem; }
/* Kalimba: physical left/right staggered steel tines and a central long key. */
#ix-tuner .tuner-quick-grid--tines {
  display: flex;
  align-items: flex-start;
  gap: .22rem;
  min-width: 0;
  max-width: 100%;
  height: 13rem;
  overflow-x: auto;
  padding: .9rem .65rem;
  border: 1px solid #796043;
  border-radius: .65rem;
  background: linear-gradient(140deg, #6d4e32, #b98b5a 50%, #65452d);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .25);
}
#ix-tuner .tuner-tine {
  flex: 0 0 2.65rem;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 3.6rem;
  padding: .35rem .05rem;
  border: 1px solid #78858e;
  border-radius: .3rem .3rem .6rem .6rem;
  background: linear-gradient(90deg, #7d8990 0%, #c8d1d5 24%, #f3f7f6 52%, #a0adb3 80%, #58666c 100%);
  color: #151e22;
  font: inherit;
  font-size: .71rem;
  font-weight: 750;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 1px 2px 4px rgba(0, 0, 0, .4);
}
#ix-tuner .tuner-tine:hover { filter: brightness(1.08); }
#ix-tuner .tuner-tine.is-selected {
  border: 3px solid #2563eb;
  padding: calc(.35rem - 2px) 0;
  background: linear-gradient(90deg, #98d5ff, #e3f4ff, #8bc3ee);
}
#ix-tuner .tuner-tine:focus-visible {
  outline: 3px solid #fff1aa;
  outline-offset: 2px;
}

@media (max-width: 520px) {
  #ix-tuner .tuner-actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  #ix-tuner #tuner-needle { transition: none; }
}
