.ch-page { width: var(--page); margin: 0 auto; }
.ch-page [hidden] { display: none !important; }
.ch-page.page-columns, .ch-page .page-columns, #ch-explorer.page-columns { display: block !important; }
.ch-page .page-columns > * { grid-column: auto !important; }
.ch-heading { max-width: 820px; margin: 3rem 0 1.5rem; }
.ch-heading .eyebrow { color: var(--gold); margin-bottom: .7rem; }
.ch-heading h1 { color: var(--paper); font-size: clamp(2.2rem, 7vw, 4.6rem); line-height: 1.06; margin: 0 0 1rem; }
.ch-heading h1 em { color: var(--gold); }
.ch-heading > p:last-child { color: var(--soft); font-size: 1.05rem; max-width: 64ch; }
.ch-loading { color: var(--soft); }
.ch-page button { font-family: var(--sans); }
.ch-page button:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }

.ch-panel { position: relative; margin-bottom: 1.5rem; padding: clamp(1.25rem, 3vw, 1.9rem); border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.ch-panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; border-radius: var(--radius) var(--radius) 0 0; background: var(--rainbow); }
.ch-panel .eyebrow { margin-bottom: .3rem; }
.ch-panel h2 { margin: 0 0 .5rem; padding: 0; border: 0; color: var(--ink); font-size: clamp(1.7rem, 3vw, 2.3rem); }
.ch-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .8rem 1.5rem; }
.ch-transport { display: flex; flex-wrap: wrap; gap: .5rem; }
.ch-play { padding: .6rem 1.4rem; border: 0; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 1rem; font-weight: 600; cursor: pointer; }
.ch-play kbd { margin-left: .35rem; padding: 0 .3rem; border-radius: 4px; background: rgba(0,0,0,.14); color: inherit; font-size: .7rem; }
.ch-play.is-hit { transform: translateY(1px); box-shadow: 0 0 0 4px rgba(255,199,44,.35); }
.ch-btn { padding: .55rem 1rem; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font-size: .88rem; cursor: pointer; }
.ch-group-label { margin: 0 0 .4rem; color: var(--muted); font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.ch-group-label span { margin-left: .4rem; color: var(--muted); letter-spacing: 0; text-transform: none; }

/* The guitar, on a dark studio floor */
.ch-stage { position: relative; margin-top: 1rem; padding: .4rem .6rem; border-radius: 16px;
  background:
    radial-gradient(ellipse 60% 80% at 70% 50%, rgba(255,200,120,.14), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 2px, transparent 2px 9px),
    radial-gradient(ellipse at 55% 45%, #3a2a24, #17110f 80%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), inset 0 -18px 30px rgba(0,0,0,.3); }
.ch-guitar { display: block; width: 100%; height: auto; }
.ch-str { transition: stroke .2s, opacity .3s; }
.ch-str.is-ring { stroke: #fff2c4; }
.ch-str.is-oct.is-off { opacity: .22; }
.ch-comb { opacity: 0; transition: opacity .3s; }
.ch-comb.is-on { opacity: 1; }
.ch-finger { transition: opacity .3s; }

/* Theories and players */
.ch-theories { margin-top: 1.1rem; }
.ch-theory-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.ch-theory-row button, .ch-toggles button { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .6rem .8rem; border: 1.5px solid var(--paper-line); border-radius: 12px; background: #fffaf0; color: var(--ink); text-align: left; cursor: pointer; }
.ch-theory-row strong, .ch-toggles strong { font-size: .95rem; }
.ch-theory-row span, .ch-toggles span { color: var(--muted); font-size: .78rem; }
.ch-theory-row button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.ch-theory-row button[aria-pressed="true"] span { color: var(--gold); }

.ch-band { margin-top: 1rem; }
.ch-players { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.ch-player { position: relative; display: grid; grid-template-rows: auto auto auto 1fr; justify-items: start; gap: .05rem; padding: .55rem .7rem .6rem; border: 1.5px solid var(--paper-line); border-left: 6px solid var(--pc); border-radius: 12px; background: #fffaf0; color: var(--ink); text-align: left; cursor: pointer; }
.ch-player svg { width: 100%; height: 54px; margin-bottom: .2rem; }
.ch-player strong { font-size: .92rem; }
.ch-player .ch-inst { color: var(--muted); font-size: .74rem; }
.ch-player .ch-pnotes { margin-top: .25rem; color: var(--ink); font-family: var(--mono); font-size: .74rem; }
.ch-player kbd { position: absolute; top: .45rem; right: .5rem; padding: 0 .3rem; border-radius: 4px; background: #efe6d2; color: var(--muted); font-size: .66rem; }
.ch-player[aria-pressed="false"] { border-left-color: #d9cfbb; background: #f4eee2; }
.ch-player[aria-pressed="false"] svg, .ch-player[aria-pressed="false"] .ch-pnotes { opacity: .3; }
.ch-player[aria-pressed="false"] strong::after { content: " · out"; color: var(--muted); font-weight: 400; }
.ch-player.is-hit { box-shadow: 0 0 0 3px var(--pc); }
.ch-player.is-none .ch-pnotes { color: var(--muted); }

/* Notes and spectrum */
.ch-look { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1rem 1.5rem; margin-top: 1.1rem; }
.ch-keys { position: relative; height: 96px; border-radius: 6px; background: #1d1714; padding: 4px 4px 6px; touch-action: manipulation; }
.ch-keys-in { position: relative; height: 100%; }
.ch-key { position: absolute; top: 0; padding: 0; border: 0; cursor: pointer; }
.ch-key.w { height: 100%; border-radius: 0 0 4px 4px; background: linear-gradient(180deg, #f2ead8, #fffaf0 70%, #e7dcc4); box-shadow: inset -1px 0 0 #b9ab90; }
.ch-key.b { z-index: 2; height: 60%; border-radius: 0 0 3px 3px; background: linear-gradient(180deg, #2a2420, #0d0a09); box-shadow: inset 0 -3px 0 #3d342e; }
.ch-key.is-c::after { content: attr(data-oct); position: absolute; bottom: 3px; left: 0; right: 0; color: var(--muted); font-family: var(--mono); font-size: 9px; text-align: center; }
.ch-key:active { filter: brightness(.9); }
.ch-dot { position: absolute; z-index: 3; width: 11px; height: 11px; margin-left: -5.5px; border: 2px solid rgba(0,0,0,.25); border-radius: 50%; pointer-events: none; transition: transform .15s; }
.ch-dot.is-harm { border: 2px dashed var(--pc); background: transparent !important; }
.ch-dot.is-hit { transform: scale(1.45); }
.ch-names { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.ch-pcs { width: 100%; margin: 0 0 .15rem; font-size: .88rem; }
.ch-pcs b { font-family: var(--mono); letter-spacing: .04em; }
.ch-name { padding: .15rem .55rem; border: 1px solid var(--paper-line); border-radius: 999px; background: #f4eee2; color: var(--muted); font-family: var(--mono); font-size: .76rem; transition: background .2s, color .2s; }
.ch-name.is-fit { border-color: var(--ink); background: var(--ink); color: var(--gold); }

.ch-scope-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .3rem .8rem; }
.ch-scope-head .ch-group-label { margin: 0; }
.ch-who { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .4rem; }
.ch-who button { padding: .25rem .65rem; border: 1.5px solid var(--paper-line); border-radius: 999px; background: #fffaf0; color: var(--ink); font-size: .76rem; cursor: pointer; }
.ch-who button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.ch-spec { display: block; width: 100%; height: auto; aspect-ratio: 4 / 1; border-radius: 8px; background: #17110f; }

.ch-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-top: 1rem; max-width: 620px; }
.ch-toggles button[aria-pressed="true"] { border-color: var(--purple); background: #f1eafc; }
.ch-toggles button[aria-pressed="true"] strong::before { content: "✓ "; color: var(--purple); }
.ch-status { margin: 1rem 0 0; padding: .55rem .8rem; border-radius: 8px; background: #fdf0cf; font-size: .88rem; }
.ch-fine { margin: .8rem 0 0; color: var(--muted); font-size: .78rem; }

/* The story */
.ch-story > p:not(.eyebrow) { max-width: 80ch; }
.ch-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0 1.2rem; }
.ch-step { padding: 1rem 1.1rem; border: 1px solid var(--paper-line); border-radius: 10px; background: #fffaf0; font-size: .9rem; }
.ch-step h3 { margin: .4rem 0 .3rem; color: var(--ink); font-size: 1.15rem; }
.ch-step p { margin: 0; }
.ch-n { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--ink); color: var(--gold); font-family: var(--mono); font-size: .72rem; }
.ch-story a { color: var(--pink-ink); }
.ch-method { max-width: 90ch; margin: 1.75rem 0; color: var(--soft); font-size: .82rem; }
.ch-method a { color: var(--gold); }
.ch-signoff { margin: 2rem 0; text-align: center; font-family: var(--serif); font-size: 1.2rem; }

@media (max-width: 1000px) { .ch-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ch-look { grid-template-columns: minmax(0, 1fr); } .ch-players { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .ch-theory-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ch-play kbd, .ch-player kbd { display: none; } .ch-players { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ch-stage { padding: .2rem; } }
@media (max-width: 560px) {
  .ch-steps, .ch-toggles, .ch-players { grid-template-columns: minmax(0, 1fr); } .ch-keys { height: 80px; }
  .ch-players { gap: .35rem; }
  .ch-player { grid-template-columns: 76px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: .7rem; padding: .45rem .6rem; }
  .ch-player svg { grid-row: 1 / 4; height: 40px; margin: 0; align-self: center; }
  .ch-player .ch-pnotes { margin-top: .1rem; }
}
@media (prefers-reduced-motion: reduce) { .ch-str, .ch-dot, .ch-name, .ch-comb { transition: none; } }

/* Strum it yourself */
.ch-strum { cursor: pointer; }
.ch-strum-hint { fill: #ffd76a; font-family: var(--mono); font-size: 14px; opacity: .9; pointer-events: none; animation: ch-hint 2.4s ease-in-out infinite; }
@keyframes ch-hint { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ch-strum-hint { animation: none; } }
