:root {
  --bg: #10110f;
  --panel: #171914;
  --panel-soft: #1d2019;
  --line: #31372d;
  --line-soft: #272c24;
  --ink: #f3f0e8;
  --muted: #9b9f92;
  --lime: #d7ec66;
  --lime-dark: #a8be42;
  --blue: #a7c8ff;
  --red: #ff887c;
  --wood: #be8b57;
  --wood-light: #d7a66e;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); }
body { margin: 0; min-width: 320px; font-family: var(--sans); background: radial-gradient(circle at 85% 5%, #242a1b 0, transparent 28rem), var(--bg); }
button, select, textarea { font: inherit; }
button { cursor: pointer; }
.topbar { height: 68px; padding: 0 clamp(20px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 14px; letter-spacing: .04em; }
.brand-mark { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid var(--lime); color: var(--lime); font: 16px var(--serif); border-radius: 50%; }
.brand-dot { color: var(--lime); }
.top-meta { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); }
.shell { width: min(1200px, calc(100% - 40px)); margin: 0 auto; padding: 76px 0 80px; }
.hero { display: flex; justify-content: space-between; gap: 40px; align-items: flex-end; margin-bottom: 72px; }
.eyebrow, .section-kicker { margin: 0 0 15px; color: var(--lime); font-size: 10px; letter-spacing: .18em; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 22px; max-width: 750px; font-size: clamp(42px, 7vw, 82px); line-height: .92; letter-spacing: -.065em; font-weight: 500; }
h1 em { color: var(--lime); font-family: var(--serif); font-weight: 400; letter-spacing: -.055em; }
.hero-copy { max-width: 535px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.hero-note { flex: 0 0 130px; width: 130px; height: 130px; border: 1px solid var(--line); border-radius: 50%; display: flex; flex-direction: column; justify-content: center; align-items: center; transform: rotate(-8deg); color: var(--lime); }
.hero-note span { font: 57px/.8 var(--serif); }
.hero-note small { margin-top: 12px; color: var(--muted); font-size: 9px; line-height: 1.3; letter-spacing: .16em; text-transform: uppercase; text-align: center; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 14px; }
.panel { min-height: 430px; padding: 28px; background: rgba(23,25,20,.93); border: 1px solid var(--line); border-radius: 5px; }
.panel-heading, .section-heading-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
h2 { margin-bottom: 0; font-size: 26px; font-weight: 500; letter-spacing: -.04em; }
.ghost-button, .text-button { border: 0; padding: 4px 0; background: transparent; color: var(--muted); font-size: 12px; }
.ghost-button:hover, .text-button:hover { color: var(--lime); }
.field-label { display: block; margin: 52px 0 10px; color: var(--muted); font-size: 12px; }
textarea { width: 100%; min-height: 112px; resize: vertical; padding: 16px; border: 1px solid var(--line); border-radius: 3px; outline: none; background: #0e100d; color: var(--ink); font: 17px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; transition: border-color .2s; }
textarea:focus { border-color: var(--lime-dark); }
.help { margin: 10px 0 0; color: #777c70; font-size: 11px; line-height: 1.55; }
code { color: var(--blue); }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 25px; }
.control { display: grid; gap: 8px; color: var(--muted); font-size: 11px; }
select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 3px; background: #0e100d; color: var(--ink); outline: none; }
select:focus { border-color: var(--lime-dark); }
.action-row { display: flex; gap: 8px; margin-top: 25px; }
.primary-button { flex: 1; display: flex; justify-content: space-between; align-items: center; padding: 13px 15px; border: 1px solid var(--lime); border-radius: 3px; background: var(--lime); color: #1a1d12; font-weight: 700; font-size: 13px; }
.primary-button:hover { background: #e8f68d; }
.icon-button { width: 45px; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--ink); }
.icon-button:hover { border-color: var(--lime); color: var(--lime); }
.stats { min-height: 53px; display: flex; align-items: flex-end; gap: 23px; padding: 35px 0 14px; border-bottom: 1px solid var(--line-soft); }
.stat strong { display: block; color: var(--lime); font: 28px/.9 var(--serif); }
.stat span { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.difficulty { padding: 7px 9px; border: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.notation { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 22px 0; min-height: 155px; }
.note-chip { min-width: 52px; padding: 9px 7px 8px; border: 1px solid var(--line); border-radius: 3px; text-align: center; color: var(--ink); background: #11130f; transition: transform .18s, border-color .18s, background .18s; }
.note-chip:hover { transform: translateY(-3px); }
.note-chip .source { display: block; color: var(--muted); font: 13px ui-monospace, monospace; }
.note-chip .source.single { color: var(--ink); font: 17px var(--serif); }
.note-chip .target { display: block; margin-top: 5px; font: 17px var(--serif); }
.note-chip .finger { display: block; margin-top: 7px; color: var(--lime); font-size: 9px; text-transform: uppercase; }
.note-chip.natural { border-color: #6e5439; background: linear-gradient(160deg, #2b2117, #15140f); }
.note-chip.chromatic { border-color: #4c678f; background: linear-gradient(160deg, #172338, #11130f); }
.note-chip.missing { border-color: #814d49; background: #251716; color: var(--red); }
.note-chip.missing .target, .note-chip.missing .finger { color: var(--red); }
.bar-break { width: 8px; height: 38px; border-left: 1px solid var(--line); margin: 0 4px; }
.report-message { min-height: 42px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.instrument-section { margin-top: 78px; }
.instrument-facts { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.instrument-facts span { padding: 7px 9px; border: 1px solid var(--line); }
.instrument-card { position: relative; overflow: hidden; margin-top: 22px; padding: 72px 24px 28px; border: 1px solid #5e4128; border-radius: 5px; background: linear-gradient(135deg, #624125, #291d14 42%, #18150f); box-shadow: inset 0 0 90px rgba(0,0,0,.42); }
.instrument-card:before { content: ''; position: absolute; inset: 0; opacity: .16; pointer-events: none; background: repeating-linear-gradient(96deg, transparent 0 31px, #efb477 32px 33px, transparent 34px 74px); }
.layer-label { position: absolute; z-index: 1; left: 24px; display: grid; gap: 3px; text-transform: uppercase; letter-spacing: .12em; font-size: 9px; color: #edd9bd; }
.layer-label small { color: #a98868; font-size: 8px; letter-spacing: .08em; }
.upper-label { top: 22px; }
.tine-row { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(17, minmax(0, 1fr)); align-items: start; min-height: 0; }
.upper-row { height: 170px; align-items: start; z-index: 4; transform: translateY(-8px); }
.lower-row { height: 230px; margin-top: -170px; align-items: start; z-index: 3; }
.tine { position: relative; width: min(100%, 56px); min-width: 8px; justify-self: center; align-self: start; height: var(--tine-height, 190px); border: 1px solid rgba(235,221,196,.45); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #332719; background: linear-gradient(90deg, #c18c54, #e2b47c 52%, #a96e3e); box-shadow: 1px 2px 0 rgba(0,0,0,.35); transition: transform .15s, filter .15s, box-shadow .15s; }
.tine.upper { color: #1c2a3d; background: linear-gradient(90deg, #9bb6d1, #d1e0ef 52%, #7894b1); align-items: flex-start; padding-top: 13px; }
.tine.lower { align-self: start; }
.tine:hover, .tine.active { filter: brightness(1.22); transform: translateY(-7px) !important; box-shadow: 0 0 0 2px var(--lime), 0 7px 16px rgba(0,0,0,.35); z-index: 5; }
.tine.lower:hover, .tine.lower.active { transform: translateY(-3px) !important; z-index: 1; }
.tine.upper.active { box-shadow: 0 0 0 2px var(--blue), 0 7px 16px rgba(0,0,0,.35); }
.tine-label { writing-mode: horizontal-tb; transform: none; white-space: nowrap; font: 11px/1 var(--serif); letter-spacing: -.04em; }
.tine.upper .tine-label { position: absolute; top: 13px; }
.tine.lower .tine-label { position: absolute; bottom: 28px; }
.tine-number { position: absolute; bottom: 8px; font: 11px ui-monospace, monospace; opacity: .8; }
.tine.upper .tine-number { top: auto; bottom: 8px; }
.instrument-caption { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; color: #b89d7e; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.instrument-caption span { display: inline-flex; align-items: center; gap: 6px; }
.instrument-caption span:last-child { margin-left: auto; color: var(--lime); }
.legend-swatch { width: 8px; height: 8px; display: inline-block; border-radius: 2px; background: var(--wood-light); }
.legend-swatch.chromatic { background: var(--blue); }
.notes-section { margin-top: 80px; }
.section-heading-row.compact { align-items: center; }
.reading-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.reading-card { min-height: 160px; padding: 20px; border: 1px solid var(--line); background: var(--panel); }
.card-number { color: var(--lime); font: 18px var(--serif); }
.reading-card h3 { margin: 26px 0 9px; font-size: 14px; font-weight: 500; }
.reading-card p { margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.footer { display: flex; justify-content: space-between; width: min(1200px, calc(100% - 40px)); margin: 0 auto; padding: 22px 0 30px; border-top: 1px solid var(--line-soft); color: #686d62; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
@media (max-width: 760px) {
  .topbar { height: 58px; }
  .top-meta { font-size: 9px; }
  .shell { width: min(100% - 28px, 580px); padding-top: 49px; }
  .hero { align-items: flex-start; margin-bottom: 47px; }
  .hero-note { flex-basis: 88px; width: 88px; height: 88px; }
  .hero-note span { font-size: 38px; }
  h1 { font-size: clamp(40px, 12vw, 62px); }
  .hero-copy { font-size: 13px; }
  .workspace { grid-template-columns: 1fr; }
  .panel { min-height: auto; padding: 21px; }
  .report-panel { min-height: 350px; }
  .field-label { margin-top: 38px; }
  .instrument-section, .notes-section { margin-top: 55px; }
  .instrument-card { padding-left: 12px; padding-right: 12px; }
  .layer-label { left: 12px; }
  .instrument-facts { max-width: 170px; justify-content: flex-end; }
  .tine-row { gap: 1px; }
  .upper-row { padding: 0 5px; }
  .tine.upper { height: var(--tine-height); }
  .tine.lower { height: var(--tine-height); }
  .tine-label { font-size: 8px; }
  .tine-number { font-size: 8px; bottom: 5px; }
  .instrument-caption { gap: 10px; font-size: 8px; }
  .instrument-caption span:last-child { flex-basis: 100%; margin-left: 0; }
  .reading-grid { grid-template-columns: 1fr; }
}
