:root {
  color-scheme: light;
  --ink: #12191f;
  --paper: #e8ecef;
  --board: #c7cdd1;
  --board-edge: #9ba4aa;
  --fret: rgba(35, 39, 41, 0.58);
  --accent: #176da3;
  --accent-dark: #0b456b;
  --accent-ring: rgba(23, 109, 163, 0.25);
  --accidental: #e1e5e7;
  --fret-marker-gray: rgba(102, 107, 110, 0.5);
}

@font-face {
  font-family: "Bravura Music";
  src: url("assets/Bravura.otf") format("opentype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  min-width: 320px;
  position: relative;
  background: #e8edf1;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.9), transparent 32%),
    radial-gradient(circle at 88% 82%, rgba(90, 124, 148, 0.16), transparent 34%),
    linear-gradient(135deg, #eef2f5 0%, #dde5ea 52%, #e8edf1 100%);
}

button {
  font: inherit;
}

input {
  font: inherit;
}

.workspace {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(330px, 370px) minmax(420px, 470px) minmax(180px, 230px);
  gap: clamp(8px, 1.6vw, 22px);
  width: min(1440px, 100%);
  height: 100dvh;
  margin: 0 auto;
  padding: clamp(6px, 1.2vh, 12px);
}

.brand {
  position: static;
  align-self: start;
  min-width: 0;
  width: auto;
  padding-top: clamp(26px, 8vh, 86px);
  text-align: left;
}

.brand-mark {
  display: inline-flex;
  width: 43px;
  height: 43px;
  margin: 0 0 clamp(10px, 1.6vh, 16px) 0.34em;
  border-radius: 11px;
  text-decoration: none;
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
:root[data-theme="dark"] .brand-mark img { content: url("./assets/chordmaj7-logo-reverse.png"); }

.brand-mark:hover { opacity: .82; }
.brand-mark:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.brand h1 {
  margin: 0 0 clamp(18px, 3vh, 30px);
  font-family: inherit;
  font-size: clamp(3.6rem, 6vw, 5.4rem);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 0.84;
}

.brand h1 span {
  display: block;
}

.brand-tools { display: grid; gap: 8px; width: min(220px,100%); margin-left: .55em; }
.utility-button { min-height: 40px; border: 1px solid rgba(23,109,163,.55); border-radius: 12px; background: rgba(255,255,255,.82); color: var(--accent-dark); cursor: pointer; font-weight: 850; }
.utility-button:hover, .utility-button:focus-visible { background: var(--accent); color: white; }

.brand #brandSubtitle {
  margin: 0 0 0 0.34em;
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.mode-instructions {
  display: grid;
  gap: 5px;
  max-width: 350px;
  margin: clamp(18px, 3vh, 30px) 0 0 0.55em;
  color: rgba(18, 25, 31, 0.82);
  font-size: clamp(0.9rem, 1.15vw, 1.05rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.mode-instructions strong {
  font-size: 1.05em;
  font-weight: 850;
}

#instructionText {
  white-space: pre-line;
}

.brand-language {
  width: max-content;
  margin: 0 0 clamp(12px, 2vh, 20px) 0.34em;
}

.volume-control {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 800;
}

.volume-control input {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.setting-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 2px;
  border: 1px solid rgba(18, 25, 31, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
}

.setting-button {
  min-width: 31px;
  min-height: 27px;
  padding: 2px 5px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4c5961;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 850;
}

.setting-button.active {
  background: var(--ink);
  color: white;
}

.note-spelling-toggle .setting-button {
  font-size: 1rem;
  line-height: 1;
}

.neck-area {
  --fretboard-height: min(870px, calc(100dvh - 100px));
  display: grid;
  grid-template-columns: 42px 34px auto;
  gap: 7px;
  height: min(900px, calc(100dvh - 100px));
  align-self: center;
  justify-self: center;
  min-width: 0;
  min-height: 0;
  transform: translateX(clamp(28px, 3vw, 50px));
}

.fret-numbers,
.fretboard {
  display: grid;
  grid-template-rows: minmax(0, 1.12fr) repeat(15, minmax(0, 1fr));
  min-height: 0;
}

.fret-numbers {
  height: calc(var(--fretboard-height) - 2px);
  margin-top: 2px;
  color: var(--ink);
  font-size: clamp(0.68rem, 1.45vh, 0.8rem);
  font-weight: 800;
}

.fretboard {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  width: 100%;
  height: calc(100% - 2px);
  margin-top: 2px;
  overflow: hidden;
  border: 1px solid rgba(73, 48, 22, 0.48);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(75, 44, 15, 0.22), transparent 10%, rgba(255, 255, 255, 0.12) 50%, transparent 90%, rgba(75, 44, 15, 0.22)),
    url("assets/maple-fretboard.webp") center / cover no-repeat,
    #e8bd7f;
  box-shadow:
    inset 9px 0 14px -12px rgba(48, 27, 8, 0.72),
    inset -9px 0 14px -12px rgba(48, 27, 8, 0.72),
    0 12px 34px rgba(20, 24, 27, 0.18);
}

.fretboard-wrap {
  position: relative;
  width: clamp(286px, 25vw, 326px);
  height: var(--fretboard-height);
  min-width: 0;
  min-height: 0;
  overflow: visible;
}

.finger-strip {
  position: absolute;
  top: -39px;
  left: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  width: 100%;
  height: 29px;
  color: var(--accent);
  font-size: clamp(1.3rem, 2.5vh, 1.58rem);
  font-weight: 650;
  line-height: 1;
}

.finger-label {
  display: grid;
  place-items: end center;
}

.volume-fader {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  color: var(--accent-dark);
  font-size: .76rem;
  font-weight: 850;
}

.fader-console {
  display: grid;
  width: 100%;
  height: 32px;
  place-items: center;
}

.volume-fader input {
  width: 100%;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.fret-number,
.note-cell {
  display: grid;
  place-items: center;
}

.fret-number {
  width: 100%;
  padding: 0 4px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: right;
}

.fret-number:first-child {
  transform: translateY(4px);
}

.fret-number:hover,
.fret-number:focus-visible,
.fret-number.selected-row {
  color: var(--accent);
}

.fret-number:focus-visible {
  outline: 2px solid rgba(23, 109, 163, 0.42);
  outline-offset: -2px;
}

.lookup-mode .fret-number {
  color: var(--ink);
  cursor: default;
  opacity: 1;
}

.note-cell {
  position: relative;
  min-height: 0;
  border-bottom: 1px solid rgba(63, 58, 51, 0.76);
  box-shadow: inset 0 -1px rgba(255, 255, 255, 0.34);
  cursor: pointer;
}

.note-cell::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1.5px;
  background: rgba(245, 241, 229, 0.8);
  box-shadow: 1px 0 rgba(50, 44, 37, 0.28);
}

.note-cell.position-marker::after {
  --marker-size: clamp(11.2px, 1.76vh, 16px);
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 100%;
  width: var(--marker-size);
  height: var(--marker-size);
  border-radius: 50%;
  background: var(--fret-marker-gray);
  transform: translate(-50%, -50%);
}

.open-cell {
  border-bottom: 4px solid rgba(18, 25, 31, 0.82);
  background: rgba(255, 245, 222, 0.18);
}

.open-cell .note-button {
  align-self: end;
  margin-bottom: clamp(2px, 0.38vh, 4px);
}

.mute-cell {
  border-bottom: 1px solid var(--fret);
  background: rgba(247, 249, 250, 0.58);
}

.mute-cell::before {
  display: none;
}

.mute-label {
  font-size: 0.72rem;
}

.note-button {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: clamp(26px, 4.4vh, 38px);
  height: clamp(26px, 4.4vh, 38px);
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: #fffefa;
  color: var(--ink);
  cursor: pointer;
  font-size: clamp(0.66rem, 1.45vh, 0.8rem);
  font-weight: 850;
  line-height: 1;
  transition: transform 100ms ease;
}

.note-button.accidental {
  background: var(--accidental);
  font-size: clamp(0.55rem, 1.2vh, 0.68rem);
}

.mute-button {
  border-color: transparent;
  background: transparent;
  color: #5c6870;
  font-size: clamp(0.72rem, 1.55vh, 0.88rem);
  font-weight: 900;
}

.mute-button:hover {
  background: rgba(255, 255, 255, 0.72);
}

.mute-button.selected {
  border-color: #7c2531;
  background: #a73545;
  color: white;
  box-shadow: 0 0 0 4px rgba(167, 53, 69, 0.2);
}

.note-button:hover {
  transform: scale(1.08);
}

.note-button:focus-visible {
  outline: 3px solid rgba(23, 109, 163, 0.5);
  outline-offset: 2px;
}

.note-button.selected {
  border-color: var(--accent-dark);
  background: var(--accent);
  color: white;
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.results {
  position: relative;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: min(820px, calc(100dvh - 144px));
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 34px rgba(20, 24, 27, 0.1);
}

.results-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.voicing-column {
  align-self: center;
  min-width: 0;
}

.voicing-note {
  padding: 16px 17px;
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: rgba(255, 255, 255, 0.68);
  color: #41515c;
  font-size: clamp(0.86rem, 1.05vw, 0.98rem);
  font-weight: 600;
  line-height: 1.45;
}

.voicing-note[hidden] {
  display: none;
}

.voicing-note strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 850;
}

.voicing-note p {
  margin: 0;
}

.site-copyright {
  margin: 10px 4px 0;
  color: #41515c;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.35;
}

.site-copyright a {
  color: inherit;
}

.app-version {
  display: inline-block;
  margin-top: 3px;
  font-size: 0.92em;
  letter-spacing: 0.02em;
}

.voicing-definitions {
  display: grid;
  gap: 10px;
  margin: 13px 0 0;
}

.voicing-definitions div,
.voicing-definitions dd {
  margin: 0;
}

.voicing-definitions dt {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  color: var(--ink);
  font-weight: 850;
}

.voicing-definitions dd {
  font-size: 0.82em;
  line-height: 1.35;
}

.voicing-note .voicing-availability {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid rgba(65, 81, 92, 0.22);
  font-size: 0.82em;
  line-height: 1.4;
}

.definition-star {
  display: inline-grid;
  place-items: center;
  font-size: 1.25rem;
  line-height: 1;
  transform: translateY(-0.03em);
}

.spread-definition {
  color: #73c995;
}

.shell-definition {
  color: #72bde0;
}

.rootless-definition {
  color: #e47f88;
}

.below-results-controls {
  grid-row: 3;
  align-self: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding-inline: 4px;
}

.result-controls {
  flex: 0 0 auto;
  padding: clamp(7px, 1.1vw, 12px) clamp(8px, 1.2vw, 14px) 0;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid rgba(18, 25, 31, 0.2);
  border-radius: 999px;
  background: rgba(199, 205, 209, 0.72);
}
.mode-toggle[hidden] { display: none; }

.unified-heading {
  color: var(--ink);
  font-size: clamp(.92rem, 1.8vh, 1.08rem);
  font-weight: 900;
}

.mode-button {
  min-width: 0;
  padding: clamp(5px, 0.8vh, 8px) 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4c5961;
  cursor: pointer;
  font-size: clamp(0.72rem, 1.45vh, 0.86rem);
  font-weight: 800;
}

.mode-button.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 7px rgba(11, 69, 107, 0.25);
}

.secondary-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.playback-controls,
.fret-move-controls {
  display: flex;
  align-items: center;
}

.playback-controls {
  flex: 0 0 auto;
  gap: 6px;
}

.fret-move-controls {
  gap: 8px;
}

.neck-area > .fret-move-controls {
  display: grid;
  grid-template-rows: minmax(0, 1.12fr) repeat(15, minmax(0, 1fr));
  align-self: stretch;
  align-content: stretch;
  gap: 0;
  height: calc(var(--fretboard-height) - 2px);
  margin-top: 2px;
}

.neck-area > .fret-move-controls button {
  align-self: center;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 0 3px;
}

.move-button-stack {
  grid-row: 7 / span 2;
  display: flex;
  width: 100%;
  align-self: center;
  flex-direction: column;
  gap: 8px;
}
#moveDownButton,
#moveUpButton { height: 48px; min-height: 48px; }
#replayButton { grid-row: 10; transform: translateY(12px); }
.fret-replay-button span { display: block; font-size: 1.45rem; font-weight: 600; line-height: 1; }

.fret-move-controls button {
  min-width: 42px;
  min-height: 42px;
  padding: 0 8px;
  border: 1px solid #9fb2bb;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
}

.fret-move-controls button + button {
  border-left: 1px solid #9fb2bb;
}

.fret-move-controls button:hover,
.fret-move-controls button:focus-visible {
  background: var(--accent);
  color: white;
}

.fret-move-controls button:focus-visible {
  outline: 2px solid rgba(23, 109, 163, 0.42);
  outline-offset: 2px;
}

.fret-move-controls button:disabled {
  background: #d4dbde;
  color: #667780;
  cursor: default;
}

.tuning-control {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
  color: #52616c;
  font-size: 0.72rem;
  font-weight: 850;
}

.tuning-control select {
  min-width: 0;
  width: min(255px, 100%);
  height: 31px;
  padding: 3px 28px 3px 9px;
  border: 1px solid rgba(18, 25, 31, 0.28);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
}

.tuning-control select:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgba(23, 109, 163, 0.25);
  outline-offset: 1px;
}

.replay-button {
  min-height: 31px;
  padding: 3px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 850;
}

.feedback-button,
.share-button {
  display: inline-grid;
  min-height: 31px;
  place-items: center;
  padding: 3px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 850;
  text-decoration: none;
}

.feedback-button:hover,
.feedback-button:focus-visible,
.share-button:hover,
.share-button:focus-visible {
  background: var(--accent);
  color: white;
}

.feedback-button:focus-visible,
.share-button:focus-visible {
  outline: 3px solid rgba(23, 109, 163, 0.42);
  outline-offset: 2px;
}

.feedback-dock {
  position: absolute;
  z-index: 2;
  bottom: calc(clamp(6px, 1.2vh, 12px) + 12px);
  left: calc(clamp(6px, 1.2vh, 12px) + 0.55em);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.feedback-dock .app-version {
  margin: 0;
  color: #52616c;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.feedback-dialog {
  width: min(440px, calc(100% - 28px));
  padding: 0;
  border: 1px solid rgba(23, 109, 163, 0.3);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(16, 24, 32, 0.28);
}

.feedback-dialog::backdrop {
  background: rgba(16, 24, 32, 0.48);
  backdrop-filter: blur(2px);
}

.app-dialog {
  width: min(520px, calc(100% - 28px));
  max-height: min(88dvh, 820px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(23,109,163,.3);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(16,24,32,.28);
}
.app-dialog::backdrop { background: rgba(16,24,32,.48); backdrop-filter: blur(2px); }
.app-dialog form, .help-content { display: grid; gap: 16px; padding: 22px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-heading h2, .dialog-heading p { margin: 0; }
.dialog-heading p { margin-top: 3px; color: #52616c; font-size: .82rem; }
.dialog-close { border: 0; background: transparent; color: var(--ink); cursor: pointer; font-size: 1.7rem; line-height: 1; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-cancel { min-height: 44px; border: 1px solid rgba(23,109,163,.55); border-radius: 12px; background: white; color: var(--accent-dark); cursor: pointer; font-weight: 850; }
.dialog-done { min-height: 44px; border: 0; border-radius: 12px; background: var(--accent); color: white; cursor: pointer; font-weight: 850; }
.dialog-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.dialog-fieldset legend, .config-dialog label > span { display: block; margin: 0 0 6px; color: #52616c; font-size: .76rem; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.config-dialog .tuning-control {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  width: 100%;
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
}
.config-dialog .tuning-control select { width: 100%; max-width: none; height: 42px; border-radius: 12px; }
.note-spelling-select { display: block; }
.note-spelling-select select { width: 100%; height: 42px; padding: 0 38px 0 13px; border: 1px solid #aebbc1; border-radius: 12px; background: #fff; color: var(--ink); font: inherit; font-weight: 850; cursor: pointer; }
.note-spelling-select select:focus-visible { outline: 3px solid rgba(23,124,173,.22); border-color: var(--blue); }
.config-dialog .volume-control { gap: 6px; }
.config-dialog .setting-toggle { width: 100%; }
.config-dialog .setting-button { min-height: 40px; width: auto; padding-inline: 16px; font-size: .85rem; font-weight: 800; }
.night-mode-control {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 12px;
  border: 1px solid rgba(18,25,31,.22);
  border-radius: 12px;
  cursor: pointer;
}
.config-dialog .night-mode-label { margin: 0; color: var(--ink); font-size: .9rem; font-weight: 750; letter-spacing: 0; text-transform: none; }
.night-mode-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.night-mode-switch { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #b7c2c8; transition: background 140ms ease; }
.night-mode-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; transition: transform 140ms ease; }
.night-mode-control input:checked + .night-mode-switch { background: var(--accent); }
.night-mode-control input:checked + .night-mode-switch::after { transform: translateX(18px); }
.night-mode-control input:focus-visible + .night-mode-switch { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.help-dialog .mode-instructions { max-width: none; margin: 0; }
.help-dialog .voicing-note { margin: 0; }

.feedback-form {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.feedback-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.feedback-heading h2,
.feedback-form p {
  margin: 0;
}

.feedback-heading h2 {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.feedback-form > p:not(.feedback-status) {
  color: #52616c;
  font-size: 0.86rem;
  line-height: 1.45;
}

.feedback-form > .feedback-version {
  margin-top: -8px;
  font-size: 0.74rem;
  font-weight: 700;
}

.feedback-form label {
  font-size: 0.82rem;
  font-weight: 850;
}

.feedback-form input[type="email"],
.feedback-form textarea {
  padding: 12px;
  border: 1px solid #aebbc3;
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
}

.feedback-form textarea {
  min-height: 150px;
  resize: vertical;
}

.feedback-form input[type="email"]:focus-visible,
.feedback-form textarea:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgba(23, 109, 163, 0.25);
  outline-offset: 1px;
}

.optional-label {
  color: #52616c;
  font-size: 0.9em;
  font-weight: 600;
}

.feedback-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #edf3f6;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.feedback-cancel,
.feedback-submit {
  min-height: 36px;
  padding: 6px 15px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
}

.feedback-cancel {
  border: 1px solid #aebbc3;
  background: white;
  color: var(--ink);
}

.feedback-submit {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
}

.feedback-submit:disabled {
  cursor: wait;
  opacity: 0.62;
}

.feedback-status {
  min-height: 1.25em;
  color: #52616c;
  font-size: 0.8rem;
  font-weight: 700;
}

.feedback-status.success {
  color: #19733b;
}

.feedback-status.error {
  color: #a52b2b;
}

.feedback-trap {
  position: fixed;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.replay-button:hover,
.replay-button:focus-visible {
  background: var(--accent-dark);
}

.replay-button:focus-visible {
  outline: 3px solid rgba(23, 109, 163, 0.42);
  outline-offset: 2px;
}

.replay-button:disabled {
  border-color: #aeb7bd;
  background: #aeb7bd;
  cursor: default;
  opacity: 0.65;
}

.mode-button:focus-visible,
.lookup-form input:focus-visible {
  outline: 3px solid rgba(23, 109, 163, 0.42);
  outline-offset: 2px;
}

.lookup-form {
  margin-top: clamp(6px, 0.9vh, 9px);
}

.lookup-form input {
  width: 100%;
  height: clamp(34px, 5vh, 44px);
  padding: 4px 11px;
  border: 1.5px solid rgba(18, 25, 31, 0.32);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: clamp(1rem, 2.3vh, 1.25rem);
  font-weight: 800;
}

.lookup-form input.invalid {
  border-color: #a51e2d;
}

.lookup-form input::placeholder {
  color: #aeb5ba;
  opacity: 1;
}

.lookup-examples {
  margin-top: 5px;
  padding-inline: 2px;
  color: #5f6c74;
  font-size: clamp(0.72rem, 1.35vh, 0.82rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.no-conventional-chord {
  color: #59656d;
  font-weight: 750;
}

.lookup-status {
  margin-top: clamp(5px, 0.7vh, 7px);
  padding-inline: 2px;
  font-size: clamp(0.72rem, 1.4vh, 0.84rem);
  font-weight: 800;
  line-height: 1.1;
}

.lookup-status.error {
  color: #8d1725;
}

.interpretation-list {
  display: flex;
  gap: 5px;
  margin-top: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.interpretation-list[hidden] { display: none; }
.interpretation-list::-webkit-scrollbar { display: none; }

.interpretation-button {
  flex: 0 0 auto;
  min-height: 25px;
  padding: 2px 8px;
  border: 1px solid rgba(18, 25, 31, 0.24);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: clamp(0.64rem, 1.18vh, 0.74rem);
  font-weight: 850;
  white-space: nowrap;
}

.interpretation-button:hover,
.interpretation-button:focus-visible,
.interpretation-button.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(23, 109, 163, 0.14);
}

html[data-theme="dark"] .interpretation-button {
  border-color: #526976;
  background: #22333d;
  color: #dcecf4;
}

.voicing-filters {
  display: flex;
  gap: 5px;
  margin-top: 6px;
  padding-bottom: 1px;
  overflow-x: auto;
  scrollbar-width: none;
}

.playability-filters { margin-top: 4px; }

.voicing-filters[hidden] {
  display: none;
}

.voicing-filters::-webkit-scrollbar {
  display: none;
}

.voicing-filter {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  min-height: 25px;
  padding: 2px 8px;
  border: 1px solid rgba(18, 25, 31, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: clamp(0.64rem, 1.18vh, 0.74rem);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.voicing-filter.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}
.voicing-filter:disabled { opacity: 0.42; cursor: default; }

.voicing-filter:focus-visible {
  outline: 3px solid rgba(23, 109, 163, 0.42);
  outline-offset: 1px;
}

.filter-star {
  display: inline-grid;
  place-items: center;
  font-size: 1.05em;
  line-height: 1;
  transform: translateY(-0.03em);
}

.spread-filter .filter-star {
  color: #73c995;
}

.shell-filter .filter-star {
  color: #72bde0;
}

.rootless-filter .filter-star {
  color: #e47f88;
}

.candidate-list {
  display: grid;
  align-content: start;
  gap: clamp(4px, 0.75vh, 8px);
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: clamp(8px, 1.2vw, 14px);
  overflow: hidden;
  list-style: none;
}

.lookup-list {
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-items: start;
  gap: clamp(3px, 0.55vh, 6px);
  margin-bottom: 20px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.shape-candidate {
  display: block;
  min-height: max-content;
  padding: 7px 10px;
  cursor: pointer;
  font-size: clamp(0.74rem, 1.65vh, 0.92rem);
}

.shape-candidate.active {
  border-color: var(--accent-dark);
  background: #eef7fc;
  box-shadow: inset 0 0 0 1px var(--accent-dark);
}

.custom-voicing-header label { flex: 1 1 auto; min-width: 0; }
.custom-chord-name {
  width: min(100%, 240px);
  min-height: 32px;
  padding: 4px 9px;
  border: 1px solid var(--accent-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 850;
}

.shape-copy {
  grid-column: 1;
  min-width: 0;
}

.voicing-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  margin-bottom: 6px;
}

.voicing-position {
  min-width: 0;
  font-size: .78rem;
  font-weight: 900;
  line-height: 1.15;
}

.voicing-badges {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.voicing-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  color: var(--ink);
  font-size: .68rem;
  line-height: 1.15;
}

.voicing-table th,
.voicing-table td {
  padding: 3px 2px;
  border-top: 1px solid rgba(117,137,147,.24);
  text-align: center;
}

.voicing-table thead th {
  padding-top: 2px;
  border-top: 0;
  color: #68767d;
  font-size: .58rem;
  font-weight: 900;
}

.voicing-table th:first-child {
  width: 24%;
  color: #31576a;
  font-weight: 900;
  text-align: left;
}

.voicing-table td { font-weight: 850; }

.voicing-category {
  color: #3d8e68;
  font-size: .6rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.voicing-category.rootless { color: #d26071; }
.voicing-category.shell { color: #8b68ad; }

.shape-frets,
.shape-intervals {
  display: block;
  white-space: nowrap;
}

.shape-fingering {
  display: block;
  margin-top: 2px;
  color: #56646c;
  font-size: clamp(0.64rem, 1.2vh, 0.72rem);
  font-weight: 750;
  white-space: nowrap;
}

.playability-badge {
  display: inline-block;
  min-width: 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e8eef1;
  color: #33424a;
  font-size: clamp(0.62rem, 1.15vh, 0.72rem);
  font-style: normal;
  font-weight: 850;
}
.playability-badge.playable { background: #ddf2e5; color: #25603b; }
.playability-badge.stretch { background: #fff0c9; color: #76530d; }
.playability-badge.study { background: #ece7f4; color: #5a4276; }

.shape-frets {
  font-weight: 850;
}

.shape-frets .muted-fret {
  color: var(--fret-marker-gray);
}

.shape-intervals {
  margin-top: 2px;
  color: #4c5961;
  font-size: clamp(0.8rem, 1.55vh, 0.94rem);
  font-weight: 800;
}

.shape-category {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-left: 0;
  padding-left: 6px;
  color: var(--ink);
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.shape-category-name {
  display: inline-flex;
  align-items: center;
  font-size: clamp(0.72rem, 1.35vh, 0.84rem);
  line-height: 1;
}

.shape-category-star {
  display: inline-grid;
  place-items: center;
  height: 1em;
  font-size: clamp(2.15rem, 4vh, 2.45rem);
  line-height: 1;
  transform: translateY(-0.03em);
}

.spread-category .shape-category-star {
  color: #73c995;
}

.shell-category .shape-category-star {
  color: #72bde0;
}

.rootless-category .shape-category-star {
  color: #e47f88;
}

.note-label {
  position: relative;
  z-index: 30;
  pointer-events: none;
}

.note-button.lookup-member {
  overflow: visible;
  border-color: transparent;
  background: transparent;
  color: white;
  box-shadow: none;
}

.lookup-stack {
  position: absolute;
  z-index: 20;
  inset: 0;
  pointer-events: none;
}

.lookup-disc {
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(18, 25, 31, 0.72);
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(var(--disc-offset));
}

.finger-badge {
  position: absolute;
  z-index: 32;
  right: -5px;
  bottom: -5px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid white;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 0.58rem;
  font-weight: 900;
}

.lookup-mode .note-button {
  cursor: default;
}

.lookup-mode .note-button.lookup-member {
  cursor: default;
}

.candidate {
  display: flex;
  align-items: center;
  min-height: clamp(34px, 4.8vh, 44px);
  padding: 4px clamp(7px, 1.1vw, 12px);
  border: 1px solid rgba(18, 25, 31, 0.14);
  border-radius: 10px;
  background: rgba(252, 251, 247, 0.95);
  font-family: inherit;
  font-size: clamp(1rem, 2.5vh, 1.35rem);
  font-weight: 700;
  line-height: 1.05;
}

.candidate.shape-candidate {
  display: block;
  min-height: max-content;
  height: auto;
  padding: 8px 10px 9px;
}

.shape-copy {
  line-height: 1.12;
}

.candidate-list:not(.lookup-list) .candidate:first-child {
  border-color: rgba(23, 109, 163, 0.52);
  background: #eef7fc;
}

.qualifier {
  color: var(--accent-dark);
  font-family: inherit;
  font-size: 0.58em;
  font-weight: 800;
  white-space: nowrap;
}

.played-intervals {
  margin-left: 9px;
  color: #4c5961;
  font-family: inherit;
  font-size: 0.68em;
  font-weight: 800;
  white-space: nowrap;
}

/* Unified finder layout */
.workspace {
  grid-template-columns: minmax(430px, 500px) minmax(365px, 416px) minmax(150px, 170px) minmax(480px, 1fr);
  width: min(2048px, 100%);
  gap: clamp(8px, 1.15vw, 18px);
}
.brand {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, auto) 1fr auto;
  align-self: stretch;
  height: 100%;
  padding: 4px 0 62px;
}
.brand-heading { display: flex; align-items: center; gap: 14px; margin: 0 8px 8px; }
.brand-mark { flex: 0 0 43px; margin: 0; transform: none; }
.brand h1 { margin: 0; font-size: clamp(1.75rem, 2.4vw, 2.55rem); letter-spacing: -.045em; line-height: 1; white-space: nowrap; }
.chord-card { min-width: 0; padding: 14px; border: 1px solid rgba(255,255,255,.9); border-radius: 22px; background: rgba(255,255,255,.84); box-shadow: 0 12px 32px rgba(23,35,42,.1); }
.setup-summary { display: block; width: 100%; margin: 0 0 10px; padding: 2px 8px; border: 0; border-radius: 8px; background: transparent; color: #5f6c74; font: inherit; font-size: .83rem; line-height: 1.45; text-align: center; }
.setup-summary:hover, .setup-summary:focus-visible { background: #e5f4fb; color: var(--accent-dark); }
.chord-picker { display: grid; gap: 7px; }
.fretboard-sticky {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: min(285px, calc(100% - 48px));
  min-height: 210px;
  place-content: center;
  gap: 16px;
  padding: 30px 28px;
  transform: translate(-50%, -50%) rotate(-1.5deg);
  border: 1px solid #e2c94f;
  background: linear-gradient(145deg, #fff59a, #ffe979);
  box-shadow: 0 18px 28px rgba(64, 54, 10, .24), inset 0 -18px 28px rgba(222, 188, 37, .12);
  color: #40370b;
  text-align: center;
}
.fretboard-sticky::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 94px;
  height: 24px;
  transform: translateX(-50%) rotate(1deg);
  background: rgba(255, 248, 209, .72);
  box-shadow: 0 1px 3px rgba(80, 63, 4, .12);
}
.fretboard-sticky strong { font-size: 1.75rem; line-height: 1; }
.fretboard-sticky span { font-size: 1rem; font-weight: 750; line-height: 1.45; }
.fretboard-sticky[hidden] { display: none; }
.picker-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.picker-group legend { display: block; margin: 0 0 5px 3px; color: #5f6c74; font-size: .66rem; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.type-picker-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 3px -3px; }
.type-picker-heading > span { color: #5f6c74; font-size: .66rem; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.type-picker-heading .chord-naming-link { position: relative; top: -5px; }
.root-buttons { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 3px; }
.type-buttons { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 7px; }
.type-family-column { display: grid; align-content: start; gap: 7px; min-width: 0; }
.type-family { min-width: 0; padding: 6px; border: 1px solid #d3dde1; border-radius: 10px; background: rgba(255,255,255,.48); }
.type-family-label { display: block; margin: 0 0 5px 2px; color: #5f6c74; font-size: .58rem; font-weight: 900; letter-spacing: .055em; text-transform: uppercase; }
.type-family-buttons { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px; }
.type-family-column > .omission-picker { min-width: 0; padding: 6px; border: 1px solid #d3dde1; border-radius: 10px; background: rgba(255,255,255,.48); }
.type-family-column > .omission-picker legend { margin-left: 2px; padding: 0 3px; }
.chord-naming-link { display: inline-block; color: var(--accent-dark); font-family: "Segoe UI", Arial, sans-serif; font-size: .72rem; font-stretch: normal; font-weight: 800; letter-spacing: .01em; text-underline-offset: 3px; white-space: nowrap; }
.omission-buttons, .bass-buttons { display: grid; gap: 4px; }
.omission-buttons { grid-template-columns: repeat(3,minmax(0,1fr)); }
.bass-buttons { grid-template-columns: repeat(13,minmax(0,1fr)); }
.root-buttons button, .type-buttons button, .omission-buttons button, .bass-buttons button { min-width: 0; min-height: 29px; padding: 0 3px; overflow: hidden; border: 1px solid #aebbc1; border-radius: 7px; background: white; color: var(--ink); font-size: .66rem; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.root-buttons button { min-height: 33px; padding-inline: 1px; }
.root-buttons button.active, .type-buttons button.active, .omission-buttons button.active, .bass-buttons button.active { border-color: var(--accent-dark); background: var(--accent); color: white; box-shadow: inset 0 0 0 1px var(--accent-dark); }
.omission-buttons button:disabled { cursor: default; opacity: .38; }
.selected-chord-name { display: block; }
.picker-footer { display: grid; grid-template-columns: 1fr; gap: 7px; }
.picker-footer .clear-button { width: 100%; min-height: 39px; }
.brand-tools { align-self: end; display: grid; gap: 8px; width: 100%; margin: 8px 0 0; padding: 10px; border: 1px solid rgba(255,255,255,.9); border-radius: 18px; background: rgba(255,255,255,.78); }
.transport-controls { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; }
.settings-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.brand-tools .utility-button { width: 100%; min-height: 42px; }
.brand-tools .volume-fader { width: 100%; }
.brand-tools .fret-move-controls { margin: 0; }
.results-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-self: stretch;
  min-height: 0;
  padding: 50px 0 14px;
}
.results { grid-row: auto; height: auto; min-height: 0; border-radius: 22px; }
.results-footer {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 8px 0;
}
.results-footer .feedback-dock {
  position: static;
}
.results-footer .site-copyright { display:flex; align-items:center; gap:14px; margin:0; text-align:right; }
.results-footer .site-copyright>span { display:block; }
.notation-panel {
  position: relative;
  align-self: stretch;
  justify-self: center;
  display: grid;
  grid-template-rows: 72px auto;
  align-content: center;
  gap: 2px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  pointer-events: none;
  user-select: none;
}
.notation-panel .staff-chord-name,
.notation-panel .grand-staff { transform: translateX(20px); }
.staff-chord-name {
  --chord-symbol-length: 1;
  --chord-omission-length: 1;
  display: grid;
  width: 100%;
  min-height: 0;
  height: 72px;
  place-items: center;
  align-content: end;
  gap: 1px;
  color: var(--accent-dark);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.05;
  text-align: center;
}
.staff-chord-symbol,
.staff-chord-omissions {
  display: block;
  max-width: 100%;
  white-space: nowrap;
}
.staff-chord-symbol {
  font-size: clamp(.82rem, calc(1.9rem - var(--chord-symbol-length) * .055rem), 1.75rem);
}
.staff-chord-omissions {
  font-size: clamp(.64rem, calc(1.05rem - var(--chord-omission-length) * .018rem), .86rem);
  font-weight: 600;
}
.grand-staff { display: block; justify-self: center; width: 82%; height: auto; margin-top: 18px; overflow: visible; }
.staff-line, .ledger-line { stroke: #25313a; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.staff-stem { stroke: var(--accent-dark); stroke-width: 1.7; vector-effect: non-scaling-stroke; }
.staff-stem-connector { stroke-width: 1.5; }
.staff-brace { fill: none; stroke: #25313a; stroke-width: 2.3; vector-effect: non-scaling-stroke; }
.staff-clef, .staff-notehead, .staff-accidental { font-family: "Bravura Music"; }
.staff-clef { fill: #17222c; font-size: 48px; }
.staff-notehead { fill: var(--accent-dark); font-size: 44px; text-anchor: middle; dominant-baseline: central; }
.staff-accidental { fill: #17222c; font-size: 36px; text-anchor: middle; dominant-baseline: central; }
.staff-empty { fill: #6c7880; font-size: 12px; font-weight: 750; text-anchor: middle; }
.lookup-form[hidden] { display: none; }
.unified-heading { font-size: 1rem; }
.candidate.shape-candidate {
  display: block;
  min-height: max-content;
  height: auto;
  padding: 8px 10px 9px;
}
.playability-badge { align-self: center; }

@media (max-width: 1150px) {
  .workspace {
    left: 0;
    grid-template-columns: minmax(130px, 180px) minmax(300px, 340px) minmax(270px, 320px) minmax(150px, 190px);
    gap: 8px;
    width: min(1120px, 100%);
  }

  .brand {
    position: relative;
    align-self: start;
    width: auto;
    padding-top: clamp(14px, 4vh, 42px);
  }
}

@media (max-width: 620px) {
  .workspace {
    grid-template-columns: minmax(38px, 52px) minmax(150px, 1.45fr) minmax(110px, 1fr);
    gap: 5px;
    padding: 4px;
  }

  body.lookup-mode {
    overflow: auto;
  }

  body.lookup-mode .workspace {
    grid-template-columns: minmax(38px, 52px) minmax(150px, 1.45fr) minmax(110px, 1fr);
    width: 100%;
    height: auto;
    min-height: 100dvh;
  }

  body.lookup-mode .voicing-column {
    grid-column: 2 / 4;
    grid-row: 2;
    margin: 8px 4px 14px;
  }

  .brand {
    position: relative;
    width: auto;
    padding-top: 10px;
  }

  .brand h1 {
    margin-bottom: 14px;
    font-size: clamp(1.12rem, 6vw, 1.75rem);
    letter-spacing: -0.045em;
    font-weight: 900;
  }

  .brand #brandSubtitle {
    font-size: clamp(0.7rem, 3vw, 0.9rem);
    overflow-wrap: anywhere;
  }

  .mode-instructions {
    display: none;
  }

  .note-button {
    width: clamp(18px, 3.8vh, 31px);
    height: clamp(18px, 3.8vh, 31px);
    font-size: clamp(0.55rem, 1.25vh, 0.72rem);
  }

  .note-button.accidental {
    font-size: clamp(0.47rem, 1.05vh, 0.62rem);
  }

  .mute-button {
    font-size: clamp(0.58rem, 1.3vh, 0.72rem);
  }

  .brand-language {
    margin: 0 0 10px;
  }

  .volume-control {
    font-size: 0.58rem;
  }

  .setting-button {
    min-width: 0;
    min-height: 24px;
    padding-inline: 2px;
    font-size: 0.58rem;
  }

  .fretboard,
  .results {
    border-radius: 8px;
  }

  .results {
    width: calc(100% - 29px);
    height: min(680px, calc(100dvh - 126px));
  }

  .below-results-controls {
    grid-template-columns: 1fr;
    gap: 4px;
    width: calc(100% - 29px);
    margin-top: 7px;
    padding-inline: 1px;
  }

  .neck-area {
    grid-template-columns: 30px 25px minmax(0, 1fr);
    gap: 4px;
    justify-self: stretch;
    transform: none;
  }

  .notation-panel { transform: none; }

  .fretboard-wrap {
    width: 100%;
  }

  .fretboard {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    width: 100%;
  }

  .volume-fader { width: 100%; }

  .candidate-list {
    padding: 5px;
  }

  .result-controls {
    padding: 5px 5px 0;
  }

  .secondary-controls {
    gap: 4px;
  }

  .playback-controls {
    gap: 3px;
  }

  .fret-move-controls button {
    min-width: 26px;
    min-height: 22px;
    padding: 1px 4px;
    font-size: 0.54rem;
  }

  .neck-area > .fret-move-controls {
    gap: 8px;
  }

  .neck-area > .fret-move-controls button {
    min-width: 0;
    min-height: 46px;
    padding: 0 2px;
  }

  .tuning-control {
    gap: 3px;
    font-size: 0.54rem;
  }

  .tuning-control select {
    height: 24px;
    padding: 1px 18px 1px 4px;
    font-size: 0.54rem;
  }

  .feedback-dock {
    bottom: 8px;
    left: clamp(6px, 1.2vh, 12px);
    gap: 5px;
    margin: 0;
  }

  .feedback-dock .feedback-button,
  .feedback-dock .share-button {
    min-height: 24px;
    padding: 2px 5px;
    font-size: 0.58rem;
  }

  .feedback-dock .app-version {
    font-size: 0.52rem;
  }

  .replay-button {
    min-height: 24px;
    padding: 2px 5px;
    font-size: 0.58rem;
  }

  .mode-button {
    padding-inline: 2px;
    font-size: clamp(0.58rem, 2vw, 0.7rem);
  }

  .lookup-list {
    grid-template-columns: 1fr;
  }

  .shape-candidate {
    min-height: 44px;
  }

  .candidate {
    padding-inline: 5px;
    border-radius: 6px;
    font-size: clamp(0.72rem, 2.15vh, 1rem);
  }

  .qualifier {
    display: block;
    margin-top: 2px;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .note-button {
    transition: none;
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf4f7;
  --paper: #1b2831;
  --board: #2a3943;
  --board-edge: #52636d;
  --accent: #69b6df;
  --accent-dark: #9bd2ee;
  --accent-ring: rgba(105,182,223,.28);
  --accidental: #cad3d8;
  --fret-marker-gray: rgba(210,218,222,.45);
}
html[data-theme="dark"] body { background: #111a21; }
html[data-theme="dark"] body::before {
  background:
    radial-gradient(circle at 14% 18%, rgba(73,102,119,.22), transparent 34%),
    radial-gradient(circle at 88% 82%, rgba(20,77,108,.2), transparent 36%),
    linear-gradient(135deg, #18242c 0%, #101920 54%, #17232b 100%);
}
html[data-theme="dark"] .chord-card,
html[data-theme="dark"] .brand-tools,
html[data-theme="dark"] .results { border-color: #405766; background: rgba(22,34,42,.92); box-shadow: 0 12px 34px rgba(0,0,0,.28); }
html[data-theme="dark"] .results { border-style: solid; border-width: 1px; }
html[data-theme="dark"] .type-family,
html[data-theme="dark"] .type-family-column > .omission-picker { border-color: #40515c; background: rgba(36,51,61,.78); }
html[data-theme="dark"] .root-buttons button,
html[data-theme="dark"] .type-buttons button,
html[data-theme="dark"] .omission-buttons button,
html[data-theme="dark"] .bass-buttons button,
html[data-theme="dark"] .utility-button,
html[data-theme="dark"] .dialog-cancel { border-color: #526976; background: #1b2a33; color: var(--ink); }
html[data-theme="dark"] .root-buttons button:hover,
html[data-theme="dark"] .type-buttons button:hover,
html[data-theme="dark"] .omission-buttons button:hover,
html[data-theme="dark"] .bass-buttons button:hover { background: #29404e; }
html[data-theme="dark"] .root-buttons button.active,
html[data-theme="dark"] .type-buttons button.active,
html[data-theme="dark"] .omission-buttons button.active,
html[data-theme="dark"] .bass-buttons button.active { background: var(--accent); color: #0d1a21; }
html[data-theme="dark"] .setup-summary,
html[data-theme="dark"] .picker-group legend,
html[data-theme="dark"] .type-picker-heading > span,
html[data-theme="dark"] .type-family-label,
html[data-theme="dark"] .site-copyright,
html[data-theme="dark"] .feedback-dock .app-version,
html[data-theme="dark"] .shape-fingering,
html[data-theme="dark"] .shape-intervals { color: #aebdc5; }
html[data-theme="dark"] .candidate { border-color: #3c4c56; background: #1a2831; }
html[data-theme="dark"] .shape-candidate.active,
html[data-theme="dark"] .candidate-list:not(.lookup-list) .candidate:first-child { border-color: var(--accent); background: #173446; box-shadow: inset 0 0 0 1px var(--accent); }
html[data-theme="dark"] .voicing-filter {
  border-color: #526976;
  background: #22333d;
  color: #dce8ed;
}
html[data-theme="dark"] .voicing-filter:hover:not(:disabled),
html[data-theme="dark"] .voicing-filter:focus-visible { background: #2b4350; }
html[data-theme="dark"] .voicing-filter.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #0d1a21;
}
html[data-theme="dark"] .voicing-filter:disabled { opacity: .58; }
html[data-theme="dark"] .app-dialog,
html[data-theme="dark"] .feedback-dialog { border-color: #48616f; background: #17252e; color: var(--ink); }
html[data-theme="dark"] select,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea { border-color: #526976; background-color: #111c23; color: var(--ink); }
html[data-theme="dark"] .setting-toggle { border-color: #526976; background: #111c23; }
html[data-theme="dark"] .note-spelling-select select { border-color: #526976; background: #111c23; color: #edf4f7; }
html[data-theme="dark"] .setting-button { color: #b9c8cf; }
html[data-theme="dark"] .setting-button.active { background: var(--accent); color: #0d1a21; }
html[data-theme="dark"] .night-mode-control { border-color: #526976; background: #111c23; }
html[data-theme="dark"] .note-button:not(.selected):not(.mute-button) { border-color: #263943; background: #f4f1e9; color: #12191f; }
html[data-theme="dark"] .note-button.accidental:not(.selected) { border-color: #263943; background: #ccd4d8; color: #12191f; }
html[data-theme="dark"] .note-button.selected { border-color: #174b68; }
html[data-theme="dark"] .note-button.lookup-member { border-color: transparent; }
html[data-theme="dark"] .mute-button { color: #52616a; }
html[data-theme="dark"] .mute-button:hover { background: rgba(231,238,241,.7); }
html[data-theme="dark"] .fret-move-controls button {
  border-color: #526976;
  background: #1b2a33;
  color: var(--accent-dark);
}
html[data-theme="dark"] .fret-move-controls button:disabled {
  border-color: #3e535f;
  background: #22323b;
  color: #6f8996;
}
html[data-theme="dark"] .staff-line,
html[data-theme="dark"] .ledger-line { stroke: #8296a0; }
html[data-theme="dark"] .staff-clef,
html[data-theme="dark"] .staff-accidental { fill: #b8c8cf; }
html[data-theme="dark"] .staff-notehead { fill: var(--accent); }
html[data-theme="dark"] .staff-chord-name { color: var(--accent-dark); }
html[data-theme="dark"] .site-copyright a,
html[data-theme="dark"] .chord-naming-link { color: var(--accent-dark); }
html[data-theme="dark"] .finger-strip,
html[data-theme="dark"] .notation-panel,
html[data-theme="dark"] .staff-chord-name { color: #fff; }
html[data-theme="dark"] .staff-line,
html[data-theme="dark"] .ledger-line { stroke: #fff; }
html[data-theme="dark"] .staff-clef,
html[data-theme="dark"] .staff-notehead,
html[data-theme="dark"] .staff-accidental { fill: #fff; }
html[data-theme="dark"] .staff-stem { stroke: #fff; }
