.dictionary { padding-top: 2rem; padding-bottom: 2rem; }
.dictionary h1 { font-size: clamp(1.75rem, 4.4vw, 2.7rem); line-height: 1.35; margin: 0 0 .75rem; }
.dictionary h2 { line-height: 1.4; }
.dictionary-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: clamp(.85rem, 3vw, 1.75rem); }
.dictionary-fields, .dictionary-tension-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.dictionary-fields label { display: grid; gap: .25rem; }
.dictionary label, .dictionary legend { font-weight: 700; }
.dictionary select { min-width: 0; width: 100%; min-height: 2.75rem; padding: .4rem 1.75rem .4rem .6rem; appearance: none; font: inherit; color: var(--ink); border: 1px solid #8b9b90; border-radius: 6px; background: linear-gradient(45deg, transparent 50%, var(--accent) 50%) right 15px center / 5px 5px no-repeat, linear-gradient(135deg, var(--accent) 50%, transparent 50%) right 10px center / 5px 5px no-repeat, var(--paper); }
.dictionary-tensions { min-width: 0; margin: 1rem 0; border: 1px solid var(--line); border-radius: 8px; }
.dictionary-tension-fields { grid-template-columns: repeat(3, auto minmax(0, 1fr)); align-items: center; }
.dictionary-help { color: var(--muted); font-size: .9rem; margin: .6rem 0 0; }
#chord-name { margin: 1rem 0 .2rem; }
#chord-pitches { margin: .35rem 0 .75rem; font-weight: 700; }
.dictionary .keyboard { position: relative; overflow: hidden; height: clamp(5rem, 14vw, 8rem); border: 1px solid var(--ink); border-radius: 6px; }
.dictionary .key { position: absolute; top: 0; }
.dictionary .white { height: 100%; border-right: 1px solid #87948b; background: #fffefa; }
.dictionary .black { z-index: 1; height: 62%; transform: translateX(-50%); background: var(--ink); border: 1px solid var(--ink); border-radius: 0 0 4px 4px; }
.dictionary .white.played { background: #b9d4bc; box-shadow: inset 0 -5px var(--accent); }
.dictionary .black.played { background: #618e70; box-shadow: inset 0 -4px #c0d9c3; }
.dictionary .octave { position: absolute; bottom: .2rem; left: 50%; transform: translateX(-50%); font-size: .75rem; }
#chord-listen { margin-top: 1rem; font: inherit; font-weight: 700; border: 0; cursor: pointer; }
#chord-listen[hidden], #chord-voicing-description[hidden] { display: none; }
#chord-audio-status:empty { margin: 0; }
.dictionary-practice { margin-top: 1.5rem; padding: 1.25rem; background: #e9eee8; border: 1px solid var(--line); border-radius: 12px; }
.dictionary-practice h2, .dictionary-practice p:last-child { margin: 0; }
.dictionary-links { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1rem; margin-bottom: 1rem; }
@media (max-width: 620px) {
  .dictionary-fields { grid-template-columns: minmax(0, 1fr); }
  .dictionary-tension-fields { gap: .35rem; }
  .dictionary .octave { font-size: .65rem; }
  .dictionary .dictionary-links { align-items: stretch; flex-direction: column; }
}

.home-chord-search { --paper:#f8f8f4; --ink:#24372d; --accent:#315746; --line:#c8d2c8; --muted:#4b6054; max-width:1100px; padding:0 20px; margin:28px auto; color:var(--ink); }
.home-chord-search h2 { margin:0 0 .75rem; font-size:clamp(1.3rem,3vw,1.8rem); }
.home-chord-input { display:flex; gap:.5rem; }
.home-chord-input input { flex:1; min-width:0; min-height:44px; padding:.45rem .75rem; border:1px solid #829387; border-radius:6px; background:#fff; color:var(--ink); font:inherit; }
.home-chord-search button { min-height:44px; padding:.45rem .9rem; background:var(--accent); color:white; border:0; border-radius:6px; font:inherit; font-weight:700; cursor:pointer; }
.home-chord-search [hidden] { display:none !important; }
.home-chord-search a { color:var(--accent); text-decoration:underline; text-underline-offset:3px; font-weight:700; }
.home-chord-result { display:flex; flex-wrap:wrap; align-items:end; justify-content:space-between; gap:.5rem 1rem; margin-top:.85rem; }
.home-chord-result h3 { font-size:1.5rem; margin:0 !important; }
.home-chord-result select { min-width:9rem; }
.home-chord-links { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem 1rem; margin-top:1rem; }
.home-chord-search #chord-listen { margin:0; }
#home-chord-error { margin:.4rem 0 0; color:#8a2929; }
#home-chord-error:empty { display:none; }

.dictionary-examples { margin-top: 1.75rem; }
.dictionary-examples ul { padding-inline-start: 1.25rem; }
.dictionary-examples li + li { margin-top: .4rem; }
