.toolkit {
  min-width: 0;
  max-width: 960px;
}
.toolkit h1 { margin-bottom: 22px; }
.tool-tabs,
.tool-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}
.tool-tabs { margin-bottom: 14px; }
.tool-tabs > button { flex: 1 1 100px; }
.tool-area { padding: clamp(14px, 3vw, 28px); min-width: 0; }
.tool-area h2 { font: 700 24px/1.25 Manrope, var(--font); margin: 0 0 6px; }
.tool-area p { margin: 0 0 16px; color: #53634f; }
.tool-area .tool-subtle { margin: 10px 0 0; }
.tool-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #c9d5c3;
  border-radius: 8px;
  background: var(--paper);
  color: var(--green);
  font-weight: 650;
}
.tool-button:hover { background: var(--soft); }
.tool-button.is-primary,
.tool-tabs .tool-button[aria-pressed="true"] {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}
.tool-button.is-primary:hover { background: var(--dark); }
.tool-reference {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.tool-reference .tool-button { flex-direction: column; padding-inline: 4px; }
.tool-reference strong { font-size: 19px; }
.tool-reference span { font-size: 12px; }
.tool-divider { margin: 20px 0; border-top: 1px solid var(--line); }
.tool-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  color: #405240;
  font-weight: 650;
}
.tool-controls select,
.tool-controls input:not([type="checkbox"]) {
  min-height: 44px;
  width: 100%;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid #c9d5c3;
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
}
.tool-controls input[type="number"] { width: 108px; }
.tool-controls .tool-check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  min-height: 44px;
}
.tool-check input { accent-color: var(--green); width: 20px; height: 20px; }
.tool-pitch-display {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 15px;
  padding: 10px 13px;
  border-radius: 8px;
  background: var(--soft);
  min-height: 60px;
}
#tool-pitch { min-width: 2ch; font-size: 22px; }
#tool-cents { width: clamp(85px, 28%, 180px); height: 20px; }
#tool-cent-text { font-variant-numeric: tabular-nums; }
.tool-beats { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.tool-beats span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #c9d5c3;
  border-radius: 50%;
  background: var(--soft);
  font-weight: 700;
}
.tool-beats span:first-child { border-width: 2px; }
.tool-beats .on { color: #fff; border-color: var(--green); background: var(--green); }
.tool-area .tool-scale-notes { margin: 16px 0 8px; font-weight: 650; }
.tool-scale-scroll { position: relative; overflow-x: auto; border-radius: 8px; background: var(--soft); }
.tool-scale-table {
  width: 100%;
  min-width: 335px;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: center;
}
.tool-scale-table th,
.tool-scale-table td { height: 39px; padding: 3px; border: 1px solid #c9d5c3; }
.tool-scale-table thead { background: #dfe6d9; }
.tool-scale-table th:first-child { width: 40px; }
.tool-scale-note { display: inline-block; padding: 3px 6px; border-radius: 6px; background: var(--paper); font-weight: 650; white-space: nowrap; }
.tool-scale-note.is-root { background: var(--green); color: #fff; }
#tool-capo-form .tool-button { margin-top: 14px; }
.tool-capo-result {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding: 13px;
  border-radius: 8px;
  background: var(--soft);
}
.tool-capo-result div { flex: 1 1 85px; }
.tool-capo-result strong { display: block; font-size: clamp(24px, 5vw, 34px); line-height: 1.2; }
.tool-capo-arrow { color: #53634f; font-size: 21px; }

@media (max-width: 720px) {
  .tool-reference { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .tool-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-controls label { flex: 1 1 95px; }
  #tool-capo-form label { flex-basis: 140px; }
}
