/* Chord Finder v5.6 — isolated fretboard component. */
.akordi-chord-finder,
.akordi-chord-finder * {
  box-sizing: border-box;
}

.akordi-chord-finder {
  --cf-red: #cf252d;
  --cf-red-dark: #ad1820;
  --cf-green: #238b45;
  --cf-ink: #191919;
  --cf-muted: #6f6f6f;
  --cf-line: #e3e3e3;
  max-width: 1180px;
  margin: 22px auto 44px;
  padding: 0 10px;
  color: var(--cf-ink);
}

/* Prevent theme-wide button rules from turning fret cells into pills. */
.akordi-chord-finder button,
.akordi-chord-finder button:hover,
.akordi-chord-finder button:focus,
.akordi-chord-finder button:active {
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
}
.akordi-chord-finder button::before,
.akordi-chord-finder button::after {
  content: none !important;
  display: none !important;
}

.chord-finder-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.chord-finder-kicker {
  margin: 0 0 6px;
  color: var(--cf-red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2.5px;
}
.chord-finder-intro {
  max-width: 720px;
  margin: 0;
  color: #696969;
  font-size: 14px;
  line-height: 1.45;
}
.chord-finder-reset {
  appearance: none !important;
  -webkit-appearance: none !important;
  flex: 0 0 auto;
  min-width: 112px;
  padding: 11px 16px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: var(--cf-red) !important;
  color: #fff !important;
  box-shadow: 0 5px 14px rgba(159, 15, 24, .18) !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.chord-finder-reset:hover {
  background: var(--cf-red-dark) !important;
  transform: translateY(-1px);
}

.chord-finder-help {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-bottom: 14px;
  padding: 9px 12px;
  border: 1px solid var(--cf-line);
  border-radius: 8px;
  background: #fafafa;
  color: #565656;
  font-size: 12px;
}
.chord-finder-help span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chord-finder-help-dot,
.chord-finder-help-open,
.chord-finder-help-muted {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  box-sizing: border-box;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}
.chord-finder-help-dot {
  border-radius: 50%;
  background: var(--cf-red);
}
.chord-finder-help-open {
  border: 2px solid var(--cf-green);
  border-radius: 50%;
  background: #fff;
  color: var(--cf-green);
}
.chord-finder-help-muted {
  border-radius: 4px;
  background: #3a3a3a;
  color: #fff;
}

.chord-finder-board-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-color: #aaa #eee;
  scrollbar-width: thin;
}
.chord-finder-board {
  display: grid;
  grid-template-columns: 104px minmax(780px, 1fr);
  min-width: 900px;
  align-items: stretch;
}

.chord-finder-side {
  display: grid;
  grid-template-rows: 28px repeat(6, 42px) 28px;
  position: relative;
  z-index: 8;
  padding-right: 8px;
}
.chord-finder-side-head,
.chord-finder-side-row {
  display: grid;
  grid-template-columns: 30px 30px 30px;
  align-items: center;
  gap: 5px;
}
.chord-finder-side-head {
  color: #777;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}
.chord-finder-string-label {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: #151515;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .18);
}
.chord-finder-mute,
.chord-finder-open {
  all: unset !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  display: grid !important;
  place-items: center !important;
  width: 27px !important;
  height: 27px !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  font: 900 12px/1 Arial, sans-serif !important;
  cursor: pointer !important;
  transition: transform .14s ease, background .14s ease, border-color .14s ease !important;
}
.chord-finder-mute {
  border: 1px solid #bcbcbc !important;
  border-radius: 50% !important;
  background: #fff !important;
  color: #333 !important;
}
.chord-finder-open {
  border: 2px solid var(--cf-green) !important;
  border-radius: 50% !important;
  background: #fff !important;
  color: var(--cf-green) !important;
}
.chord-finder-mute:hover,
.chord-finder-open:hover {
  transform: scale(1.07) !important;
}
.chord-finder-mute.is-selected {
  border-color: #3b3b3b !important;
  background: #3b3b3b !important;
  color: #fff !important;
}
.chord-finder-open.is-selected {
  border-color: var(--cf-red) !important;
  background: var(--cf-red) !important;
  color: #fff !important;
}
.chord-finder-mute:focus-visible,
.chord-finder-open:focus-visible {
  outline: 2px solid #111 !important;
  outline-offset: 2px !important;
}

.chord-finder-neck-column {
  display: grid;
  grid-template-rows: 28px 252px 28px;
}
.chord-finder-fret-numbers {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  color: #484848;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.chord-finder-fret-numbers.bottom {
  align-items: start;
  padding-top: 6px;
}
.chord-finder-fret-numbers .twelve {
  color: var(--cf-red);
}

.chord-finder-neck {
  position: relative;
  display: grid;
  grid-template-rows: repeat(6, 42px);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #2a150c;
  border-radius: 7px 12px 12px 7px;
  background-color: #2a160f;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.03), transparent 18%, rgba(255,255,255,.025) 45%, transparent 70%),
    url('../images/fretboard-rosewood.svg');
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 28px rgba(0,0,0,.72), 0 8px 18px rgba(42,22,10,.17);
}
.chord-finder-neck::before {
  content: "";
  position: absolute;
  z-index: 7;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  background: linear-gradient(90deg, #bba472 0%, #f4e4bb 45%, #d4bd8c 72%, #92794f 100%);
  box-shadow: 2px 0 4px rgba(0,0,0,.65);
  pointer-events: none;
}
.chord-finder-neck::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 30%, rgba(0,0,0,.12));
  pointer-events: none;
}
.chord-finder-marker-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}
.chord-finder-marker-layer i {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #e7e2d9;
  box-shadow: inset 0 1px 2px #fff, 0 1px 3px rgba(0,0,0,.8);
  transform: translate(-50%, -50%);
}

.chord-finder-string-row {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  min-width: 0;
}
.chord-finder-string-row::before {
  content: "";
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--string-size, 1px);
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(#f4e6ca 0%, #c7ac7f 35%, #6c563a 62%, #e3cfaa 100%);
  box-shadow: 0 1px 1px rgba(0,0,0,.85);
  pointer-events: none;
}
.chord-finder-string-row[data-string="1"] { --string-size: 1px; }
.chord-finder-string-row[data-string="2"] { --string-size: 1.25px; }
.chord-finder-string-row[data-string="3"] { --string-size: 1.55px; }
.chord-finder-string-row[data-string="4"] { --string-size: 2px; }
.chord-finder-string-row[data-string="5"] { --string-size: 2.55px; }
.chord-finder-string-row[data-string="6"] { --string-size: 3.1px; }

.chord-finder-fret-cell,
.chord-finder-fret-cell:hover,
.chord-finder-fret-cell:focus,
.chord-finder-fret-cell:active {
  all: unset !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  position: relative !important;
  display: block !important;
  min-width: 0 !important;
  width: auto !important;
  height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-right: 3px ridge rgba(211, 214, 213, .93) !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: inherit !important;
  cursor: pointer !important;
  overflow: visible !important;
  opacity: 1 !important;
  transform: none !important;
  transition: background-color .12s ease !important;
}
.chord-finder-fret-cell:hover {
  background-color: rgba(255,255,255,.055) !important;
}
.chord-finder-fret-cell:focus-visible {
  outline: 2px solid rgba(255,255,255,.85) !important;
  outline-offset: -3px !important;
}
.chord-finder-fret-cell.is-selected {
  background-color: rgba(207,37,45,.08) !important;
}
.chord-finder-note-marker {
  position: absolute;
  z-index: 9;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(.82);
  background: var(--cf-red);
  color: #fff;
  font: 900 11px/1 Arial, sans-serif;
  box-shadow: 0 2px 7px rgba(65,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}
.chord-finder-fret-cell:hover .chord-finder-note-marker {
  opacity: .35;
}
.chord-finder-fret-cell.is-selected .chord-finder-note-marker {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.chord-finder-results {
  display: grid;
  grid-template-columns: minmax(290px, 1.05fr) minmax(270px, .85fr);
  gap: 14px;
  margin-top: 12px;
}
.chord-finder-primary,
.chord-finder-details,
.chord-finder-alternatives {
  border-radius: 11px;
}
.chord-finder-primary {
  padding: 21px;
  background: linear-gradient(145deg, #1b1b1e, #0d0d0f);
  color: #fff;
  box-shadow: 0 9px 20px rgba(0,0,0,.12);
}
.chord-result-eyebrow,
.chord-finder-details span {
  display: block;
  color: #999;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.chord-finder-primary > strong {
  display: block;
  margin: 7px 0 2px;
  color: #fff;
  font-size: 46px;
  line-height: 1;
}
.chord-finder-primary > p {
  margin: 7px 0 0;
  color: #bdbdbd;
}
.chord-result-meta {
  display: grid;
  grid-template-columns: .65fr 1fr 1fr;
  gap: 11px;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.13);
}
.chord-result-meta span {
  display: block;
  color: #858585;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.chord-result-meta b {
  display: block;
  margin-top: 6px;
  color: #fff;
}
.chord-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 25px;
  margin: 0 4px 4px 0;
  padding: 0 7px;
  border-radius: 5px;
  background: #fff;
  color: #111;
  font-size: 12px;
}
.chord-finder-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  border: 1px solid #e5e5e5;
  background: #fff;
}
.chord-finder-details > div {
  min-height: 88px;
  padding: 23px;
}
.chord-finder-details > div + div {
  border-left: 1px solid #eee;
}
.chord-finder-details strong {
  display: block;
  margin-top: 9px;
  font-size: 18px;
}
.chord-finder-alternatives {
  grid-column: 1 / -1;
  padding: 17px 19px;
  border: 1px solid #e5e5e5;
  background: #fff;
}
.chord-finder-alternatives h3 {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.chord-finder-alternatives [data-alternative-list] {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chord-finder-alternatives span {
  padding: 7px 11px;
  border: 1px solid #e3e3e3;
  border-radius: 7px;
  background: #fafafa;
  font-weight: 800;
}

@media (max-width: 760px) {
  .chord-finder-header { align-items: center; }
  .chord-finder-intro { font-size: 13px; }
  .chord-finder-help { gap: 8px 14px; }
  .chord-finder-results { grid-template-columns: 1fr; }
  .chord-finder-alternatives { grid-column: auto; }
  .chord-result-meta { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .akordi-chord-finder { padding: 0 3px; }
  .chord-finder-header { gap: 9px; }
  .chord-finder-reset { min-width: 96px; padding: 10px 11px !important; font-size: 12px !important; }
  .chord-finder-board { grid-template-columns: 98px minmax(780px, 1fr); }
  .chord-finder-details { grid-template-columns: 1fr; }
  .chord-finder-details > div + div { border-left: 0; border-top: 1px solid #eee; }
}

/* Harmony engine v6 additions. */
.akordi-chord-finder .chord-result-meta {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}
.akordi-chord-finder .chord-analysis-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #d43b32;
  border-radius: 4px;
  background: rgba(212,59,50,.08);
  color: #5a2d29;
  font-size: .92rem;
  line-height: 1.45;
}
.akordi-chord-finder .chord-finder-alternatives [data-alternative-list] span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.akordi-chord-finder .chord-finder-alternatives [data-alternative-list] small {
  font-weight: 400;
  opacity: .72;
  text-align: right;
}
