/* ─── GUITAR TOOLS ───────────────────────────────────────────── */
.tools-workspace {
  align-items: center;
  justify-content: flex-start;
  gap: calc(10px * var(--ui-scale));
  padding-top: calc(18px * var(--ui-scale));
}

.tool-console {
  width: min(100%, calc(560px * var(--ui-scale)));
  margin: 0 auto;
  padding: calc(18px * var(--ui-scale));
  border: 1px solid var(--border-subtle);
  border-radius: calc(18px * var(--ui-scale));
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 36%),
    var(--bg-surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(14px * var(--ui-scale));
}

.tool-console-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.tool-console-title span {
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.3px;
}

.tool-console-title small {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.tool-actions-row {
  display: flex;
  align-items: center;
  gap: calc(8px * var(--ui-scale));
  flex-wrap: wrap;
}

.tool-actions-row.centered {
  justify-content: center;
}

.tool-primary-btn,
.tool-secondary-pill,
.tool-round-btn,
.tool-square-btn,
.tool-note-btn,
.tool-chip,
.tempo-preset {
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: inherit;
  font-weight: var(--weight-semibold);
  cursor: pointer;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--text-primary) 8%, transparent), var(--shadow-sm);
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.tool-primary-btn:hover,
.tool-secondary-pill:hover,
.tool-round-btn:hover,
.tool-square-btn:hover,
.tool-note-btn:hover,
.tool-chip:hover,
.tempo-preset:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.tool-primary-btn {
  min-height: calc(32px * var(--ui-scale));
  padding: 0 calc(14px * var(--ui-scale));
  border-radius: var(--radius-full);
  background: #31c95d;
  border-color: #31c95d;
  color: #fff;
  font-size: var(--text-sm);
  box-shadow: 0 14px 28px rgba(49, 201, 93, 0.22);
}

.tool-primary-btn.large {
  min-width: calc(118px * var(--ui-scale));
  min-height: calc(36px * var(--ui-scale));
  font-size: var(--text-sm);
}

.tool-primary-btn:hover,
.tool-primary-btn.active {
  background: #28b852;
  border-color: #28b852;
}

.tool-secondary-pill {
  min-height: calc(36px * var(--ui-scale));
  min-width: calc(132px * var(--ui-scale));
  padding: 0 calc(16px * var(--ui-scale));
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
}

.tool-round-btn {
  width: calc(42px * var(--ui-scale));
  height: calc(32px * var(--ui-scale));
  border-radius: var(--radius-full);
  font-size: var(--text-base);
}

.tool-round-btn.wide {
  width: calc(64px * var(--ui-scale));
}

.tool-square-btn,
.tool-note-btn {
  min-width: calc(36px * var(--ui-scale));
  height: calc(36px * var(--ui-scale));
  border-radius: calc(10px * var(--ui-scale));
  font-size: var(--text-sm);
}

.tool-square-btn.active,
.tool-note-btn.active,
.tempo-preset.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tool-message {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.tool-message.hidden {
  display: none;
}

.tool-message.success {
  color: var(--success);
}

.tool-message.error {
  color: var(--error);
}

.centered-message {
  text-align: center;
}

.tool-hidden-number,
.tool-hidden-select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.tool-select {
  height: calc(32px * var(--ui-scale));
  min-width: calc(100px * var(--ui-scale));
  padding: 0 calc(9px * var(--ui-scale));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  outline: none;
}

.tool-range {
  accent-color: var(--accent);
  min-width: calc(120px * var(--ui-scale));
}

.tool-volume-row,
.tool-mini-field {
  display: flex;
  align-items: center;
  gap: calc(7px * var(--ui-scale));
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.45px;
}

.tool-subsection {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: calc(7px * var(--ui-scale));
}

.tool-subsection.centered {
  align-items: center;
  text-align: center;
}

.tool-subsection h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.tool-reference-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(68px, 1fr));
  gap: calc(8px * var(--ui-scale));
}

.tool-reference-grid.compact {
  max-width: calc(470px * var(--ui-scale));
}

.tool-chip {
  min-height: calc(44px * var(--ui-scale));
  padding: calc(6px * var(--ui-scale));
  border-radius: calc(10px * var(--ui-scale));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
}

.tool-chip span,
.tool-chip small {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.tool-chip strong {
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

/* ─── METRONOME ──────────────────────────────────────────────── */
.metronome-console {
  max-width: calc(560px * var(--ui-scale));
  padding-top: calc(18px * var(--ui-scale));
}

.metronome-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(10px * var(--ui-scale));
  min-height: calc(26px * var(--ui-scale));
}

.metronome-beat-dot {
  width: calc(18px * var(--ui-scale));
  height: calc(18px * var(--ui-scale));
  border-radius: var(--radius-full);
  border: calc(2px * var(--ui-scale)) solid color-mix(in srgb, var(--text-tertiary) 34%, transparent);
  background: transparent;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.metronome-beat-dot.accent {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-default));
}

.metronome-beat-dot.active {
  transform: scale(1.18);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.metronome-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: calc(5px * var(--ui-scale));
  line-height: 1;
}

.metronome-bpm-value {
  color: var(--text-primary);
  font-size: clamp(38px, 6vw, calc(62px * var(--ui-scale)));
  font-weight: 800;
  letter-spacing: -1.6px;
}

.metronome-bpm-label {
  color: var(--text-tertiary);
  font-size: clamp(13px, 2vw, calc(18px * var(--ui-scale)));
  font-weight: 800;
  letter-spacing: 1.5px;
}

.metronome-step-row,
.metronome-main-actions,
.metronome-beats-row,
.metronome-presets {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.metronome-step-row {
  gap: calc(7px * var(--ui-scale));
}

.metronome-main-actions {
  gap: calc(15px * var(--ui-scale));
}

.metronome-beats-row {
  gap: calc(7px * var(--ui-scale));
}

.metronome-beats-row > span {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.metronome-presets {
  width: 100%;
  gap: calc(7px * var(--ui-scale));
}

.tempo-preset {
  min-width: calc(72px * var(--ui-scale));
  min-height: calc(46px * var(--ui-scale));
  border-radius: calc(10px * var(--ui-scale));
  padding: calc(6px * var(--ui-scale)) calc(9px * var(--ui-scale));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tempo-preset em {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-style: italic;
  font-weight: 800;
}

.tempo-preset strong {
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: 800;
}

/* ─── TUNER ─────────────────────────────────────────────────── */
.tuner-readout,
.tone-readout {
  width: min(100%, calc(320px * var(--ui-scale)));
  min-height: calc(104px * var(--ui-scale));
  border: 1px solid var(--border-subtle);
  border-radius: calc(16px * var(--ui-scale));
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(5px * var(--ui-scale));
}

.tuner-status-pill {
  min-width: calc(58px * var(--ui-scale));
  padding: calc(3px * var(--ui-scale)) calc(9px * var(--ui-scale));
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-align: center;
}

.tuner-note,
.tone-note-display {
  color: var(--text-primary);
  font-size: clamp(34px, 5.5vw, calc(54px * var(--ui-scale)));
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -1.6px;
}

.tuner-frequency,
.tuner-cents,
.tone-frequency-display {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-align: center;
}

.tuner-meter {
  width: min(100%, calc(360px * var(--ui-scale)));
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: calc(7px * var(--ui-scale));
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.55px;
}

.tuner-track {
  position: relative;
  height: calc(12px * var(--ui-scale));
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
}

.tuner-zone {
  position: absolute;
  inset-block: 0;
}

.flat-zone {
  left: 0;
  width: 45%;
  background: color-mix(in srgb, var(--warning) 10%, transparent);
}

.tune-zone {
  left: 45%;
  width: 10%;
  background: color-mix(in srgb, var(--success) 20%, transparent);
}

.sharp-zone {
  right: 0;
  width: 45%;
  background: color-mix(in srgb, var(--warning) 10%, transparent);
}

.tuner-center-line {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--success);
  border-radius: var(--radius-full);
}

.tuner-needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(10px * var(--ui-scale));
  height: calc(10px * var(--ui-scale));
  transform: translate(-50%, -50%);
  border: 3px solid var(--bg-surface);
  border-radius: var(--radius-full);
  background: var(--warning);
  box-shadow: var(--shadow-sm);
  transition: left var(--transition-fast), background var(--transition-fast);
}

.tuner-needle.in-tune {
  background: var(--success);
}

.tuner-needle.sharp,
.tuner-needle.flat {
  background: var(--warning);
}

/* ─── TONE GENERATOR ─────────────────────────────────────────── */
.tone-note-grid {
  width: min(100%, calc(360px * var(--ui-scale)));
  display: grid;
  grid-template-columns: repeat(6, minmax(34px, 1fr));
  gap: calc(8px * var(--ui-scale));
}

.tone-option-row,
.tone-settings-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: calc(7px * var(--ui-scale));
}

.tone-option-row > span {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

@media (max-width: 1100px) {
  .tool-reference-grid {
    grid-template-columns: repeat(3, minmax(110px, 1fr));
  }

  .metronome-presets {
    max-width: calc(330px * var(--ui-scale));
  }
}

@media (max-width: 720px) {
  .tools-workspace {
    padding: calc(14px * var(--ui-scale));
  }

  .tool-console {
    padding: calc(14px * var(--ui-scale));
    border-radius: calc(18px * var(--ui-scale));
    gap: calc(12px * var(--ui-scale));
  }

  .tool-primary-btn.large,
  .tool-secondary-pill {
    width: 100%;
    min-width: 0;
  }

  .tool-round-btn,
  .tool-round-btn.wide {
    width: calc(42px * var(--ui-scale));
  }

  .metronome-main-actions,
  .tool-actions-row {
    width: 100%;
    flex-direction: column;
  }

  .metronome-bpm-value {
    letter-spacing: -1.6px;
  }

  .metronome-bpm-label {
    letter-spacing: 2px;
  }

  .tool-reference-grid,
  .tool-reference-grid.compact {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .tone-note-grid {
    grid-template-columns: repeat(4, minmax(50px, 1fr));
  }

  .tuner-meter {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .tool-volume-row,
  .tool-mini-field {
    width: 100%;
    justify-content: center;
    flex-direction: column;
  }
}


/* compact alignment with the rest of the app typography */
.tool-console {
  font-size: var(--text-sm);
}

.tool-primary-btn,
.tool-secondary-pill,
.tool-round-btn,
.tool-square-btn,
.tool-note-btn,
.tool-chip,
.tempo-preset,
.tool-select {
  font-size: var(--text-sm);
}

.tool-console-title span,
.tool-subsection h3 {
  font-size: var(--text-base);
}

.tool-console-title small,
.tuner-status-pill,
.tuner-meter,
.tool-volume-row,
.tool-mini-field,
.metronome-beats-row > span,
.tone-option-row > span {
  font-size: var(--text-xs);
}
