/* Generador de tonos */
.tone-stage { gap: var(--space-2); }
.tone-read { text-align: center; }
.tone-read__freq { display: flex; align-items: baseline; justify-content: center; gap: 10px; font-size: clamp(3.2rem, 9vw, 5.2rem); transition: color .2s ease; }
.tone-stage.is-on .tone-read__freq { color: var(--color-accent); }
.tone-read__hz { font-family: var(--font-body); font-size: 1rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--color-gray); }
.tone-read__note { margin: 10px 0 0; display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: 1rem; color: var(--color-ink-soft); }
.tone-read__note strong { font-family: var(--font-heading); font-size: 1.5rem; color: var(--color-accent); }
.tone-read__note span { font-weight: 700; color: var(--color-ink-soft); }
.tone-read__note em { font-style: normal; font-weight: 700; color: var(--color-gray); font-variant-numeric: tabular-nums; }
.tone-read__note em.is-off { color: var(--color-warn); }

.tone-scope {
  position: relative;
  width: 100%;
  height: 150px;
  border-radius: var(--radius-media);
  background:
    linear-gradient(var(--color-hairline) 1px, transparent 1px) 0 50% / 100% 50%,
    var(--color-bg);
  border: 1px solid var(--color-hairline);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .35);
  overflow: hidden;
  cursor: ew-resize;
  touch-action: pan-y;
  transition: border-color .2s ease;
}
.tone-scope:hover, .tone-scope.is-drag { border-color: rgba(0, 205, 156, .5); }
.tone-scope canvas { width: 100%; height: 100%; display: block; }
.tone-scope__hint {
  position: absolute;
  right: 10px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-gray);
  opacity: .8;
  pointer-events: none;
  transition: opacity .3s ease;
}
.tone-scope__hint svg { width: 14px; height: 14px; }
.tone-scope.is-used .tone-scope__hint { opacity: 0; }

.tone-waves { width: 100%; }
.tone-waves button { min-height: 46px; flex-direction: column; gap: 2px; padding: 4px 6px; }
.tone-waves button svg { width: 34px; height: 20px; }
.tone-waves button span { font-size: .7rem; line-height: 1; }

.tone-actions { display: flex; align-items: center; justify-content: center; gap: var(--space-3); }

/* Octava en la cabecera del panel de notas */
.tone-oct { display: flex; align-items: center; gap: 6px; }
.tone-oct__val { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--color-gray); }
.tone-oct .stepper__value { width: 44px; height: 34px; font-size: 1rem; padding: 0; }

.note-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.note-btn {
  min-height: 52px;
  border-radius: var(--radius);
  border: 1px solid var(--color-hairline);
  background: var(--color-surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 2px;
  box-shadow: var(--shadow-sm);
  touch-action: manipulation;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.note-btn:active { transform: scale(.94); }
.note-btn b { font-size: .92rem; line-height: 1.1; }
.note-btn small { font-size: .7rem; font-weight: 700; color: var(--color-gray); }
.note-btn.is-sharp { background: var(--color-bg); }
.note-btn:hover { border-color: var(--color-accent); }
.note-btn[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-bg); box-shadow: var(--shadow-glow); }
.note-btn[aria-pressed="true"] small { color: rgba(18, 18, 18, .7); }

.tone-hz-row { flex-wrap: nowrap; }
.tone-hz-row .input { width: auto; }
.tone-hz { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tone-unit { font-weight: 700; color: var(--color-gray); }
.panel > .tone-scale { position: relative; height: 14px; margin: 2px 11px 0; font-size: .7rem; font-weight: 700; color: var(--color-gray); }
.tone-scale span { position: absolute; top: 0; transform: translateX(-50%); }
.tone-scale span:first-child { transform: none; margin-left: -8px; }
.tone-scale span:last-child { transform: translateX(-100%); margin-left: 8px; }
#hzChips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
#hzChips .chip { padding: 0 4px; }

.tone-cents { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.tone-cents .field__label { white-space: nowrap; }
.tone-cents .stepper { grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 4px; }
.tone-cents .icon-btn { width: 36px; height: 36px; }
.tone-cents .stepper__value { height: 36px; font-size: 1rem; }

.tone-warn { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: .8rem; color: var(--color-gray); }
.tone-warn svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; color: var(--color-warn); }
.tone-a4 .stepper { grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 4px; }
.tone-a4 .icon-btn { width: 36px; height: 36px; }
.tone-a4 .stepper__value { height: 36px; font-size: 1rem; }

@media (max-width: 600px) {
  .tone-stage { gap: 12px; padding-top: 14px; padding-bottom: 14px; }
  .tone-read__freq { font-size: 3rem; gap: 6px; }
  .tone-read__hz { font-size: .8rem; }
  .tone-read__note { margin-top: 6px; font-size: .9rem; gap: 8px; }
  .tone-read__note strong { font-size: 1.25rem; }
  .tone-scope { height: 84px; }
  .tone-waves button { min-height: 44px; }
  .tone-waves button span { font-size: .64rem; }
  .tone-actions { gap: var(--space-2); }
  .tone-actions .icon-btn--lg { width: 48px; height: 48px; }
  .note-btn { min-height: 44px; }
  .note-btn b { font-size: .84rem; }
  .note-btn small { font-size: .62rem; }
}
@media (max-width: 380px) {
  .tone-cents { grid-template-columns: minmax(0, 1fr) auto; }
  .tone-cents .field__label { grid-column: 1 / -1; }
}
