:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: #252820;
  background: #faf9f6;
  --ink: #252820;
  --muted: #696b61;
  --line: #e4e5dc;
  --green: #42604b;
  --orange: #aa421a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
a { color: inherit; text-underline-offset: 0.2em; }
button, input, select { font: inherit; }
button, select { min-height: 44px; color: inherit; border: 1px solid #cbd0c2; border-radius: 9px; background: #fff; }
button { padding: 0.55rem 0.9rem; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--green); background: #f1f5ed; }
button:disabled { opacity: 0.4; cursor: default; }
select { width: 100%; padding: 0.6rem 1.8rem 0.6rem 0.7rem; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
input { accent-color: var(--green); }
.container { width: min(calc(100% - 2rem), 1240px); margin-inline: auto; }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 0.2rem; border-bottom: 1px solid var(--line); }
.brand img { display: block; width: 76px; height: auto; mix-blend-mode: multiply; }
nav { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.85rem; }
nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
nav a:hover { text-decoration: underline; }
.intro { padding-block: 0.8rem; }
.subtitle { color: var(--muted); font-size: 0.85rem; line-height: 1.5; margin: 0.3rem 0 0; }
.eyebrow { color: var(--green); font-size: 0.68rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.12em; margin: 0 0 0.5rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.06em; font-weight: 650; margin-bottom: 0.35rem; }
h2 { font-size: 1.65rem; letter-spacing: -0.04em; font-weight: 600; margin-bottom: 0; }
h3 { font-size: 1rem; font-weight: 650; margin-bottom: 0.5rem; }
.workspace { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.selection-panel { background: #f3f5ee; padding: 0.35rem 0.55rem; border-bottom: 1px solid var(--line); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .field > label { display: block; font-size: 0.72rem; font-weight: 650; margin-bottom: 0.2rem; }
.quality-row { display: grid; grid-template-columns: 150px minmax(220px, 320px); gap: 0.6rem; max-width: 500px; }
.field { min-width: 0; }
.field select { font-size: 0.83rem; }
.selected-shape { display: grid; grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr); align-items: center; gap: 1rem; padding: 0.35rem 0.75rem; border-bottom: 1px solid var(--line); }
.diagram-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; }
#mainDiagram { width: min(100%, 320px); }
.chord-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; }
.chord-heading h2 { font-size: 1.45rem; }
.detail-heading { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 1rem; margin: 0; }
.finger-toggle { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 40px; color: var(--muted); font-size: 0.76rem; white-space: nowrap; cursor: pointer; }
.finger-toggle input { width: 16px; height: 16px; margin: 0; }
.shape-details { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; min-width: 0; }
.theory { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; font-size: 0.85rem; line-height: 1.5; }
.theory p { margin: 0; }
.theory span { color: var(--muted); margin-right: 0.35rem; }
.theory strong { font-weight: 550; }
.chord-diagram { display: block; width: 100%; height: auto; }
.diagram-key { margin: 0.2rem 0 0; font-size: 0.72rem; color: var(--muted); }
.root-dot { display: inline-block; width: 9px; height: 9px; background: var(--orange); border-radius: 50%; }
.bass-dot { display: inline-block; width: 9px; height: 9px; background: #7957a3; border-radius: 50%; }
.shape-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; margin: 0; }
.shape-title-row h3 { margin: 0; font-size: 1.05rem; }
.muted { color: var(--muted); font-size: 0.77rem; line-height: 1.4; margin-bottom: 0.5rem; }
.notes-section summary { cursor: pointer; min-height: 44px; display: list-item; align-content: center; font-size: 0.75rem; }
button.primary { background: var(--green); border-color: var(--green); color: #fff; }
button.primary:hover:not(:disabled) { background: #304b38; color: #fff; }
.results-heading { display: flex; justify-content: space-between; gap: 0.6rem; align-items: center; padding: 0.3rem 0.55rem; }
.results-title { display: flex; align-items: baseline; gap: 0.6rem; }
.results-heading h3 { margin: 0; }
#resultsStatus { font-size: 0.7rem; color: var(--muted); margin: 0; }
.shape-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-content: start; gap: 0.3rem; padding: 0 0.55rem 0.55rem; }
.shape-grid.gallery-compact { align-content: start; grid-auto-rows: max-content; }
.shape-card { min-width: 0; padding: 0.2rem; background: #fcfcf9; }
.shape-card[aria-pressed="true"] { border: 2px solid var(--green); padding: calc(0.2rem - 1px); background: #f0f5eb; }
.shape-card .chord-diagram { max-width: 150px; margin-inline: auto; }
.slash-shape-name { display: block; color: #7957a3; font-size: 0.72rem; font-weight: 650; line-height: 1.2; padding: 0 0.1rem 0.15rem; }
.empty-state { padding: 0.5rem 1.5rem 2rem; font-size: 0.9rem; line-height: 1.7; color: var(--muted); }
.notes-section { padding-block: 0.3rem; }
.notes-section h3 { font-size: 0.9rem; margin-bottom: 0.4rem; }
.notes-section p:not(.eyebrow) { font-size: 0.8rem; color: var(--muted); line-height: 1.8; margin-bottom: 1.2rem; }
footer { border-top: 1px solid var(--line); color: var(--muted); padding-block: 0.6rem; font-size: 0.7rem; }
.skip-link { position: absolute; top: -100px; left: 1rem; background: white; padding: 1rem; z-index: 5; }
.skip-link:focus { top: 0.5rem; }
.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; }
@media (max-width: 900px) {
.container { width: calc(100% - 1rem); }
}
@media (max-width: 700px) {
  .selected-shape { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; padding: 0.25rem 0.5rem 0.5rem; }
  .diagram-panel { max-width: 220px; margin-inline: auto; }
  #mainDiagram { width: min(100%, 220px); }
  .shape-details { display: block; width: 100%; }
  .detail-heading { margin-bottom: 0.35rem; }
  .shape-title-row { margin-bottom: 0.35rem; }
  .chord-heading h2 { font-size: 1.25rem; }
  .theory { flex-direction: row; flex-wrap: wrap; column-gap: 1rem; font-size: 0.76rem; }
  .diagram-key { margin-top: 0.35rem; }
}
@media (max-width: 520px) {
.quality-row { grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); max-width: none; }
.shape-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  .shape-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .workspace { display: grid; grid-template-columns: minmax(520px, 0.85fr) minmax(0, 1.15fr); grid-template-rows: auto auto minmax(0, 1fr); align-content: stretch; align-items: stretch; min-height: max(620px, calc(100vh - 150px)); }
  .selection-panel { grid-column: 1 / -1; }
  .selected-shape { grid-column: 1; grid-row: 2 / span 2; grid-template-columns: minmax(280px, 1.15fr) minmax(200px, 0.85fr); align-items: center; align-self: stretch; gap: 0.5rem; border-right: 1px solid var(--line); border-bottom: 0; }
  .diagram-panel { min-width: 0; }
  #mainDiagram { width: min(100%, 390px); }
  .shape-details { gap: 0.65rem; }
  .shape-details .chord-heading h2 { font-size: 1.35rem; }
  .detail-heading { gap: 0.5rem; }
  .results-heading { grid-column: 2; grid-row: 2; align-self: start; }
  .shape-grid { grid-column: 2; grid-row: 3; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: stretch; align-self: stretch; }
  .shape-grid.gallery-compact { align-content: start; }
  .shape-card { display: flex; align-items: center; justify-content: center; }
  .shape-card .chord-diagram { max-width: 270px; }
  .empty-state { grid-column: 2; grid-row: 3; align-self: start; }
  .shape-card .chord-diagram { max-width: 220px; }
}
@media (min-width: 1400px) {
  .shape-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
