@font-face { font-family: "Bravura"; src: url("./assets/Bravura.otf") format("opentype"); font-display: block; }

:root {
  color-scheme: light;
  --ink: #121a20;
  --muted: #5d6a72;
  --blue: #147cad;
  --blue-dark: #0d5f88;
  --blue-pale: #e8f5fa;
  --cream: #f8f3e8;
  --panel: rgba(255, 255, 255, 0.9);
  --line: rgba(32, 45, 53, 0.2);
  --shadow: 0 16px 42px rgba(23, 35, 42, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f2f6f8;
  --muted: #b6c4cb;
  --blue: #68b7df;
  --blue-dark: #9ed7f1;
  --blue-pale: #19384a;
  --panel: rgba(21, 36, 45, .96);
  --line: rgba(255,255,255,.18);
}
:root[data-theme="dark"] html,
:root[data-theme="dark"] body { background: #101d25; }
:root[data-theme="dark"] body { background: linear-gradient(135deg,#172833,#0f1c24 62%,#142631); }
:root[data-theme="dark"] .chord-card,
:root[data-theme="dark"] .utility-card,
:root[data-theme="dark"] .results-card { border-color: #3b5663; }
:root[data-theme="dark"] .type-family,
:root[data-theme="dark"] .type-family-column > .omission-picker { background: #20343f; }
:root[data-theme="dark"] .status { color: var(--ink); }
:root[data-theme="dark"] .status.warning { border-color: #4b86a1; background: #19384a; color: var(--ink); }
:root[data-theme="dark"] .app-dialog input,
:root[data-theme="dark"] .app-dialog textarea,
:root[data-theme="dark"] .feedback-dialog input,
:root[data-theme="dark"] .feedback-dialog textarea { border-color: #48606c; background: #172832; color: var(--ink); }
:root[data-theme="dark"] button,
:root[data-theme="dark"] select,
:root[data-theme="dark"] .type-family,
:root[data-theme="dark"] .type-family-column > .omission-picker { border-color: #48606c; }
:root[data-theme="dark"] .root-buttons button,
:root[data-theme="dark"] .type-buttons button,
:root[data-theme="dark"] .omission-buttons button,
:root[data-theme="dark"] .bass-buttons button,
:root[data-theme="dark"] .utility-button,
:root[data-theme="dark"] .clear-button,
:root[data-theme="dark"] .interpretation-list button,
:root[data-theme="dark"] .playability-filter,
:root[data-theme="dark"] .result-list button,
:root[data-theme="dark"] .app-dialog,
:root[data-theme="dark"] .feedback-dialog,
:root[data-theme="dark"] select { background: #172832; color: var(--ink); }
:root[data-theme="dark"] .finger-strip,
:root[data-theme="dark"] .notation-panel,
:root[data-theme="dark"] .staff-chord-name { color: #fff; }
:root[data-theme="dark"] .grand-staff .staff-notehead { fill: #fff; }
:root[data-theme="dark"] .grand-staff .staff-stem { stroke: #fff; }

* { box-sizing: border-box; }

html { min-width: 320px; background: #dce7ec; }

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 4%, rgba(255,255,255,.9), transparent 32%),
    linear-gradient(135deg, #edf4f6 0%, #dbe7ec 45%, #c9d9e1 100%);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.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; }

.app-shell {
  height: 100vh;
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 10px clamp(14px, 2.2vw, 34px);
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(500px, 540px) minmax(430px, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px 14px;
  overflow: hidden;
}

.topbar {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  margin: 0;
}

.brand-block { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { display: inline-flex; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 11px; text-decoration: none; transform: 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: .88; }
.brand-mark:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 11px; }
.brand-block h1 { margin: 0; font-size: clamp(2rem, 2.8vw, 2.9rem); line-height: .92; letter-spacing: -.045em; white-space: nowrap; }
.brand-block h1 span { display: inline; }

.primary-controls {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr);
  align-items: end;
  gap: 12px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 22px;
  background: rgba(255,255,255,.66);
  box-shadow: 0 10px 30px rgba(23,35,42,.09);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: clip;
  min-width: 190px;
  border: 1px solid #aebbc1;
  border-radius: 999px;
  background: #d8dfe2;
  padding: 3px;
}

.segmented button {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #536069;
  font-weight: 850;
}

.segmented button.active {
  background: var(--blue);
  color: white;
  box-shadow: 0 3px 10px rgba(20,124,173,.28);
}

.tuning-control { display: grid; gap: 5px; min-width: 0; }
.tuning-control span { margin-left: 10px; color: var(--muted); font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.tuning-control select {
  width: 100%; min-height: 40px; padding: 0 40px 0 15px;
  border: 1px solid #aebbc1; border-radius: 14px; background: white; color: var(--ink); font-weight: 800;
}

.neck-section {
  grid-column: 2;
  grid-row: 1 / 5;
  min-height: 0;
  display: block;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: 0;
}

.neck-stage { height: 100%; min-height: 0; display: grid; grid-template-columns: 40px minmax(285px,310px) minmax(145px,1fr); align-items: center; gap: 10px; }

.replay-button, .move-controls button, .neck-scroll-controls button, .fret-replay-button {
  min-height: 34px; border: 0; border-radius: 999px; padding: 0 14px; background: var(--blue); color: white; font-weight: 900;
}
.replay-button:disabled, .move-controls button:disabled, .neck-scroll-controls button:disabled { cursor: default; background: #d4dbde; color: white; }
.move-controls button:disabled, .neck-scroll-controls button:disabled { color: #667780; }
.side-controls { display: grid; align-content: center; gap: 12px; align-self: stretch; padding: 0; }
.side-controls button { min-width: 0; width: 100%; border: 1px solid #9fb2bb; border-radius: 11px; padding: 0 3px; background: rgba(255,255,255,.88); color: var(--blue-dark); }
.move-controls button { min-height: 54px; font-size: .72rem; }
.move-controls { align-content: center; gap: 8px; }
.move-controls .fret-replay-button { min-height: 54px; margin-top: 54px; font-size: 1.35rem; }
.neck-scroll-controls button { min-height: 132px; font-size: .78rem; }

.neck-viewport {
  --cell: 43px;
  --drone-cell: 31px;
  --label: 29px;
  position: relative;
  width: min(350px, 100%);
  max-height: none;
  min-height: 0;
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  padding: 39px 0 0;
  border-radius: 0;
}
.neck-viewport::-webkit-scrollbar { display: none; }

.finger-strip {
  position: absolute;
  z-index: 9;
  top: 4px;
  left: var(--label);
  display: grid;
  width: calc(100% - var(--label));
  height: 29px;
  color: var(--blue);
  font-size: clamp(1.3rem, 2.5vh, 1.58rem);
  font-weight: 650;
  line-height: 1;
  pointer-events: none;
}
.finger-label { display: grid; place-items: end center; }
.finger-label.short { visibility: hidden; }

.fretboard {
  --cell: 43px;
  --drone-cell: 31px;
  --label: 29px;
  display: grid;
  grid-template-columns: var(--label) repeat(5, minmax(var(--cell), 1fr));
  grid-template-rows: minmax(0, 1.12fr) repeat(15, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: 0;
  position: relative;
  overflow: visible;
  background: transparent;
}
.fretboard::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0 0 0 var(--neck-left, var(--label));
  border: 1px solid #8c7046;
  border-radius: 10px;
  background-color: #e7bd79;
  background-image:
    linear-gradient(90deg, rgba(75,44,15,.22), transparent 10%, rgba(255,255,255,.12) 50%, transparent 90%, rgba(75,44,15,.22)),
    linear-gradient(rgba(231,189,121,.2),rgba(231,189,121,.2)),
    url("./assets/maple-fretboard.webp");
  background-size: auto, auto, cover;
  box-shadow:
    inset 9px 0 14px -12px rgba(48,27,8,.72),
    inset -9px 0 14px -12px rgba(48,27,8,.72),
    0 12px 34px rgba(20,24,27,.18);
  pointer-events: none;
}

.corner, .fret-number, .string-label, .note-cell, .missing-cell { position: relative; display: grid; place-items: center; }
.corner, .string-label { position: sticky; top: 0; }
.corner, .fret-number { background: transparent; color: var(--ink); font-size: .68rem; font-weight: 900; }
.corner { z-index: 8; }
.fret-number { z-index: 2; border: 0; justify-items: end; padding-right: 6px; }

.string-label {
  z-index: 7;
  place-items: end center;
  padding: 0 1px clamp(2px, .38vh, 4px);
  background: rgba(255,245,222,.18);
  border-bottom: 4px solid rgba(18,25,31,.82);
  color: var(--muted); font-size: .72rem; font-weight: 800;
}
.string-label::before { content: ""; position: absolute; z-index: 0; inset: 0 auto 0 50%; width: var(--string-width, 2px); transform: translateX(-50%); background: linear-gradient(90deg,#f8f8f8,#60676a,#fff); box-shadow: 1px 0 1px rgba(0,0,0,.35); }
.string-label > * { position: relative; z-index: 2; }
.string-label.short { padding: 0; border: 0; background: transparent; }
.string-label .note-button {
  display: grid;
  place-items: center;
  width: clamp(26px, 4.4vh, 38px);
  height: clamp(26px, 4.4vh, 38px);
  padding: 0;
  border: 1.5px solid #1d2a31;
  border-radius: 50%;
  background: #fffefa;
  color: #162027;
  font-size: clamp(.66rem, 1.45vh, .8rem);
  font-weight: 850;
  line-height: 1;
}
.string-label .note-button.accidental { background: #d8e0e4; font-size: clamp(.55rem, 1.2vh, .68rem); }
.string-label .note-button.selected { border-color: var(--blue-dark); background: var(--blue); color: white; box-shadow: 0 0 0 4px rgba(20,124,173,.2); }
.string-label .mute-button { border-color: transparent; background: transparent; color: #5c6870; box-shadow: none; font-size: clamp(.72rem, 1.55vh, .88rem); font-weight: 900; }
.string-label .note-button:hover { transform: scale(1.08); border-color: var(--blue); }

.note-cell, .missing-cell { border-top: 2px solid rgba(111,86,52,.44); border-left: 1px solid rgba(75,54,29,.22); }
.note-cell::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: var(--string-width, 2px); transform: translateX(-50%); background: linear-gradient(90deg,#f8f8f8,#60676a,#fff); box-shadow: 1px 0 1px rgba(0,0,0,.35); }
.note-cell button {
  position: relative; z-index: 2; width: clamp(25px, 3vh, 34px); height: clamp(25px, 3vh, 34px); border-radius: 50%; border: 1.5px solid #1d2a31; background: #fbfaf6; color: #162027; font-weight: 900; font-size: clamp(.65rem, 1.28vh, .82rem);
  box-shadow: 0 2px 4px rgba(35,27,16,.18);
}
.note-cell button:hover { transform: translateY(-1px); border-color: var(--blue); }
.note-cell button.selected { background: var(--blue); border-color: var(--blue-dark); color: white; box-shadow: 0 0 0 6px rgba(20,124,173,.2); }
.neck-marker { position: absolute; z-index: 1; top: 50%; right: 0; width: 8px; height: 8px; transform: translate(50%,-50%); border-radius: 50%; background: #8b795a; box-shadow: inset 0 1px 2px rgba(255,255,255,.35), 0 1px 2px rgba(65,43,20,.25); pointer-events: none; }
.neck-marker.double { background: transparent; box-shadow: 0 -6px 0 #8b795a, 0 6px 0 #8b795a; }
.finger-number { position: absolute; z-index: 3; right: -6px; top: -6px; display: grid !important; place-items: center; width: 17px; height: 17px; margin: 0 !important; border: 1px solid white; border-radius: 50%; background: #17232a; color: white !important; font-size: .58rem !important; font-weight: 900; }
.missing-cell { background: rgba(222,233,237,.88); }
.missing-cell::after { display: none; }
.drone-absent { border: 0; background: transparent; }
.drone-start, .drone-tail { background: linear-gradient(90deg,#e5bd7b,#efcf96); }
.drone-start { overflow: visible; border-top-color: #147cad; }
.drone-start::before { content: ""; position: absolute; z-index: 1; left: 50%; right: -3px; top: 50%; height: 2px; background: linear-gradient(#fff,#626a6e,#fff); box-shadow: 0 1px 1px rgba(0,0,0,.3); }
.drone-start::after, .drone-tail::after { content: ""; display: block; position: absolute; left: 50%; width: 1.55px; transform: translateX(-50%); background: linear-gradient(90deg,#f8f8f8,#60676a,#fff); box-shadow: 1px 0 1px rgba(0,0,0,.35); }
.drone-start::after { top: 50%; bottom: 0; }
.drone-tail::after { top: 0; bottom: 0; }
.drone-toggle { position: relative; z-index: 3; display: grid; place-items: center; width: clamp(25px, 3vh, 34px); height: clamp(25px, 3vh, 34px); padding: 0; border-radius: 50%; font-size: clamp(.65rem, 1.28vh, .82rem); font-weight: 900; box-shadow: 0 2px 5px rgba(20,31,37,.2); }
.drone-toggle.open { border: 2px solid var(--blue-dark); background: white; color: var(--blue-dark); }
.drone-toggle.muted { border: 1px solid #95a3aa; background: #dce5e9; color: #65747b; }

/* All 15 frets fit at once, so keep the right rail balanced but unobtrusive. */
.neck-scroll-controls { visibility: hidden; }

.notation-panel { align-self: stretch; display: grid; grid-template-rows: minmax(70px,auto) 250px; place-content: center; min-width: 0; padding: 0 2px; color: var(--blue-dark); text-align: center; }
.staff-chord-name { display: grid; align-content: end; justify-items: center; min-height: 70px; max-width: 100%; color: var(--blue-dark); font-size: clamp(1.55rem,2.3vw,2.5rem); font-weight: 600; line-height: 1.05; overflow-wrap: normal; }
.staff-chord-symbol, .staff-chord-omissions { display: block; max-width: 100%; white-space: nowrap; }
.staff-chord-omissions { margin-top: 5px; font-size: .42em; font-weight: 600; }
.grand-staff { width: 100%; max-width: 175px; height: 250px; overflow: visible; }
.grand-staff .staff-line, .grand-staff .ledger-line { stroke: currentColor; stroke-width: 2.35; }
.grand-staff .staff-clef { fill: currentColor; font-family: "Bravura", serif; font-size: 48px; }
.grand-staff .staff-notehead { fill: var(--blue-dark); font-family: "Bravura", serif; font-size: 44px; text-anchor: middle; dominant-baseline: central; }
.grand-staff .staff-stem { stroke: var(--blue-dark); stroke-width: 2.7; }
.grand-staff .staff-accidental { fill: currentColor; font-family: "Bravura", serif; font-size: 38px; }

.work-area { display: contents; }
.chord-card, .utility-card, .results-card { border: 1px solid rgba(255,255,255,.9); border-radius: 22px; background: var(--panel); box-shadow: 0 12px 32px rgba(23,35,42,.1); }
.chord-card { grid-column: 1; grid-row: 2; align-self: start; min-width: 0; padding: 16px; }
.utility-card { grid-column: 1; grid-row: 3; align-self: end; display: grid; gap: 8px; padding: 10px; }
.settings-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.setup-summary { display: block; width: 100%; margin: 0 0 10px; padding: 2px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .83rem; line-height: 1.45; text-align: center; }
.setup-summary:hover, .setup-summary:focus-visible { background: var(--blue-pale); color: var(--blue-dark); }
.utility-card .replay-button, .clear-button, .utility-button { width: 100%; min-height: 42px; border-radius: 12px; padding-inline: 6px; }
.clear-button { border: 1px solid #9fb2bb; background: white; color: var(--blue-dark); font-weight: 850; }
.clear-button:disabled { cursor: default; color: #8c999f; background: #eef2f3; }
.utility-button { border: 1px solid #9fb2bb; background: white; color: var(--blue-dark); font-weight: 850; }
.instrument-note { padding: 13px 14px; border-left: 4px solid var(--blue); background: var(--blue-pale); color: #36515f; font-size: .82rem; line-height: 1.45; }

.results-card { position: relative; grid-column: 3; grid-row: 1 / 4; min-height: 0; padding: 13px; overflow: hidden; display: flex; flex-direction: column; }
.chord-picker, .status, .interpretation-list, .playability-filters { flex: 0 0 auto; }
.chord-picker { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 10px; }
.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: var(--muted); font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.root-buttons { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.type-picker-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 3px -3px; }
.type-picker-heading > span { color: var(--muted); font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.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: var(--muted); font-size: .6rem; font-weight: 900; letter-spacing: .055em; text-transform: uppercase; }
.type-family-buttons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
.chord-naming-link { display: inline-block; color: var(--blue-dark); font-size: .72rem; font-weight: 850; text-underline-offset: 3px; white-space: nowrap; }
.chord-naming-link:hover { color: var(--blue); }
.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; }
.omission-buttons, .bass-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.bass-buttons { grid-template-columns: repeat(13,minmax(0,1fr)); }
.omission-buttons button, .bass-buttons button { min-height: 30px; border: 1px solid #aebbc1; border-radius: 8px; background: white; color: var(--ink); font-size: .68rem; font-weight: 900; }
.omission-buttons button.active, .bass-buttons button.active { border-color: var(--blue-dark); background: var(--blue-pale); color: var(--blue-dark); box-shadow: inset 0 0 0 1px var(--blue); }
.omission-buttons button:disabled { cursor: default; opacity: .38; }
.root-buttons button, .type-buttons button { min-width: 0; min-height: 30px; padding: 0 3px; overflow: hidden; border: 1px solid #aebbc1; border-radius: 7px; background: white; color: var(--ink); font-size: .68rem; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.root-buttons button { min-height: 34px; padding-inline: 1px; font-size: .66rem; }
.type-buttons button:hover, .root-buttons button:hover { border-color: var(--blue); color: var(--blue-dark); }
.type-buttons button.active, .root-buttons button.active { border-color: var(--blue-dark); background: var(--blue); color: white; box-shadow: inset 0 0 0 1px var(--blue-dark); }
.picker-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.picker-footer .clear-button { min-height: 39px; }
.selected-chord-name { display: block; width: 100%; min-height: 39px; padding: 7px 12px; border: 1px solid #90c7de; border-radius: 11px; background: #eef8fc; color: var(--blue-dark); font-size: 1.16rem; font-weight: 950; }
.feedback-submit { border: 0; border-radius: 13px; padding: 0 20px; background: var(--blue); color: white; font-weight: 900; }
.status { min-height: 27px; color: #33444d; font-weight: 850; }
.status.warning { padding: 10px 12px; border: 1px solid #90c7de; border-radius: 10px; background: #eef8fc; }
.status:empty { min-height: 0; padding: 0; border: 0; background: transparent; }
.interpretation-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.interpretation-list[hidden] { display: none; }
.interpretation-list button { min-height: 34px; padding: 5px 11px; border: 1px solid #9fb2bb; border-radius: 999px; background: white; color: var(--ink); font-size: .75rem; font-weight: 850; }
.interpretation-list button span { display: block; color: var(--muted); font-size: .62rem; font-weight: 700; }
.interpretation-list button.active { border-color: var(--blue); background: var(--blue-pale); color: var(--blue-dark); }
.playability-filters { display: flex; gap: 6px; margin: 2px 0 10px; overflow-x: auto; }
.playability-filters[hidden] { display: none; }
.playability-filter { flex: 0 0 auto; min-height: 29px; padding: 4px 10px; border: 1px solid #b7c2c7; border-radius: 999px; background: white; color: var(--ink); font-size: .72rem; font-weight: 850; }
.playability-filter.active { border-color: #17232a; background: #17232a; color: white; }
.playability-filter:disabled { opacity: .42; cursor: default; }
.result-list { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 7px; max-height: none; margin: 0; padding: 0 5px 0 0; list-style: none; overflow-y: auto; }
.result-list button { position: relative; width: 100%; min-height: 168px; padding: 9px 10px 8px; text-align: left; border: 1px solid #d6d7d4; border-radius: 12px; background: #fffdf8; color: var(--ink); }
.result-list button.active { border-color: var(--blue-dark); background: var(--blue-pale); box-shadow: inset 0 0 0 2px var(--blue); }
.voicing-card-header { display: flex !important; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; margin: 0 0 6px !important; }
.result-list .voicing-position { display: block; min-width: 0; color: var(--ink); font-size: .78rem; font-weight: 900; line-height: 1.15; letter-spacing: 0; }
.result-list .playability-badge { position: static; flex: 0 0 auto; display: inline-block; padding: 3px 7px; border-radius: 999px; background: #e8eef1; color: #33424a; font-size: .62rem; font-style: normal; font-weight: 850; }
.result-list .playability-badge.playable { background: #ddf2e5; color: #25603b; }
.result-list .playability-badge.stretch { background: #fff0c9; color: #76530d; }
.result-list .playability-badge.study { background: #ece7f4; color: #5a4276; }
.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; text-align: center; border-top: 1px solid rgba(117,137,147,.24); }
.voicing-table thead th { padding-top: 2px; color: #68767d; font-size: .58rem; font-weight: 900; border-top: 0; }
.voicing-table th:first-child { width: 29%; text-align: left; color: #31576a; font-weight: 900; }
.voicing-table td { font-weight: 850; }
.voicing-card-footer { display: flex !important; justify-content: flex-end; min-height: 14px; margin: 4px 0 0 !important; }
.result-list .voicing-category { position: static; color: #3d8e68; font-size: .6rem; font-weight: 900; }
.result-list .voicing-category.rootless { color: #d26071; }
.result-list .voicing-category.shell { color: #8b68ad; }

.footer-bar { grid-column: 1 / -1; grid-row: 4; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: center; padding: 0 4px; }
.feedback-dock { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.feedback-dock button { border: 1px solid var(--blue); border-radius: 999px; padding: 8px 16px; background: transparent; color: var(--blue-dark); font-weight: 850; }
.volume-control { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; color: var(--blue-dark); font-size: .78rem; font-weight: 900; }
.volume-control input { width: 100%; accent-color: var(--blue); }
.night-mode-control { display: flex !important; align-items: center; justify-content: space-between; gap: 18px; }
.night-mode-control input { width: 42px; height: 23px; accent-color: var(--blue); }
.accidental-select { display: block; }
.accidental-select select { width: 100%; min-height: 42px; padding: 7px 38px 7px 13px; border: 1px solid #aebbc1; border-radius: 12px; background: white; color: var(--ink); font: inherit; font-weight: 850; cursor: pointer; }
.accidental-select select:focus-visible { outline: 3px solid rgba(23,124,173,.22); border-color: var(--blue); }
.copyright { justify-self: end; color: var(--muted); font-size: .72rem; line-height: 1.4; }
.copyright a { color: inherit; font-weight: 800; }

.feedback-dialog, .app-dialog { width: min(480px, calc(100% - 32px)); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 24px 80px rgba(0,0,0,.3); }
.feedback-dialog::backdrop, .app-dialog::backdrop { background: rgba(12,24,30,.55); backdrop-filter: blur(3px); }
.feedback-dialog form { display: grid; gap: 14px; padding: 22px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.dialog-heading strong, .dialog-heading span { display: block; }
.dialog-heading strong { font-size: 1.25rem; }
.dialog-heading span { color: var(--muted); font-size: .75rem; margin-top: 3px; }
.dialog-close { border: 0; background: transparent; font-size: 1.7rem; line-height: 1; }
.feedback-dialog label { display: grid; gap: 5px; font-weight: 800; font-size: .85rem; }
.feedback-dialog label span { color: var(--muted); font-weight: 600; }
.feedback-dialog textarea, .feedback-dialog input { width: 100%; border: 1px solid #b7c0c4; border-radius: 10px; padding: 10px; }
.feedback-dialog textarea { min-height: 130px; resize: vertical; }
.feedback-submit { min-height: 44px; }
.feedback-status { min-height: 18px; color: var(--blue-dark); font-size: .8rem; font-weight: 800; }
.honeypot { position: absolute !important; left: -10000px !important; opacity: 0 !important; }

.app-dialog form, .help-content { display: grid; gap: 15px; padding: 22px; }
.dialog-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.dialog-fieldset legend, .app-dialog label > span { display: block; margin: 0 0 6px; color: var(--muted); font-size: .76rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.config-dialog .segmented { width: 100%; }
.config-dialog .tuning-control { display: grid; gap: 0; }
.config-dialog .volume-control { display: grid; gap: 5px; font-weight: 900; }
.config-dialog .volume-control input { width: 100%; accent-color: var(--blue); }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-cancel { min-height: 44px; border: 1px solid rgba(20,124,173,.55); border-radius: 13px; background: white; color: var(--blue-dark); font-weight: 900; }
.dialog-done { min-height: 44px; border: 0; border-radius: 13px; background: var(--blue); color: white; font-weight: 900; }
.help-dialog p { margin: 0; color: #3d4b53; font-size: .88rem; line-height: 1.5; white-space: pre-line; }
.help-dialog .fingering-caveat { padding-top: 12px; border-top: 1px solid #d3dde1; color: var(--muted); font-size: .8rem; }

@media (max-width: 1120px) {
  body { overflow: auto; }
  .app-shell { display: block; height: auto; min-height: 100vh; overflow: visible; padding: 18px 16px 22px; }
  .topbar { grid-template-columns: 1fr; gap: 18px; }
  .brand-block h1 { white-space: normal; }
  .neck-section { margin-top: 16px; }
  .work-area { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
  .chord-card, .utility-card, .results-card { grid-column: auto; grid-row: auto; }
  .utility-card { grid-template-columns: 1fr; }
  .results-card { min-height: 360px; }
  .result-list { grid-template-columns: minmax(0, 1fr); }
  .footer-bar { grid-template-columns: 1fr 1fr; margin-top: 16px; }
  .copyright { justify-self: start; }
}

@media (max-width: 620px) {
  .app-shell { padding: 14px 10px 20px; }
  .brand-block { align-items: center; flex-direction: row; gap: 10px; }
  .neck-stage { grid-template-columns: 32px minmax(0,1fr) 36px; }
  .notation-panel { display: none; }
  .move-controls button { min-height: 46px; }
  .neck-scroll-controls button { min-height: 96px; }
  .type-buttons { grid-template-columns: 1fr; }
  .fretboard { --cell: 44px; --label: 29px; }
  .result-list { grid-template-columns: 1fr; }
  .footer-bar { grid-template-columns: 1fr; }
  .copyright { order: 4; }
}
