/* Harmony page (harmony.html): level map, placement test, and the keyboard used by the harmony lessons. Tokens from site.css only. 4/8 spacing. */
.hm .wrap { display: grid; gap: var(--s-5); min-width: 0; padding-block: var(--s-6) var(--s-8); }
.hm-kicker { margin: 0; }
.hm-title { margin: var(--s-2) 0 var(--s-3); font-size: var(--fs-xl); line-height: 1.1; letter-spacing: -.02em; word-break: keep-all; }
.hm-lede { max-width: 56ch; margin: 0; color: var(--muted); word-break: keep-all; }
.hm-host, .hm-levels { display: grid; gap: var(--s-5); min-width: 0; }
.hm-maphead { margin: var(--s-2) 0 calc(var(--s-3) * -1); font-size: var(--fs-md); }

/* Placement entry: two cards, or the saved start with a retake button. */
.hm-find { display: grid; gap: var(--s-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .hm-find { grid-template-columns: 1fr 1fr; } }
.hm-card, .hm-lab { display: grid; gap: var(--s-1); align-content: center; min-height: 72px; padding: var(--s-4) var(--s-5); color: var(--text); text-decoration: none; background: var(--surface-2); border: 1px solid var(--d-edge, var(--line)); border-radius: var(--radius-xl); box-shadow: var(--d-hi, none), var(--d-shadow-1, none); }
.hm-card:hover, .hm-lab:hover { background: var(--surface-3); }
.hm-card.is-primary { border-color: var(--accent); background: var(--accent-soft); }
.hm-card-t { font-size: var(--fs-md); font-weight: 600; }
.hm-card-l { font-size: var(--fs-sm); line-height: 1.5; color: var(--muted); word-break: keep-all; }
.hm-chip { margin: 0; font-weight: 600; }
.hm-find:has(.hm-chip) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-xl); }
.hm-retake { min-height: 44px; }

/* Level map: rows reuse the lesson list's .track / .rows / .row look. */
.hm-level { scroll-margin-top: calc(var(--header-h) + var(--s-4)); }
.hm-soon { cursor: default; opacity: .62; }
.hm-soon .go { display: none; }
.status.hm-done, .status.hm-wait { color: var(--muted); }
.hm-lab { margin-bottom: var(--s-3); }

/* Placement test */
.hm-testhost { max-width: 40rem; margin-inline: auto; width: 100%; }
.hm-q, .hm-result { display: grid; gap: var(--s-4); justify-items: start; }
.hm-steps { display: flex; gap: var(--s-3); margin: 0; padding: 0; list-style: none; font: 500 var(--fs-xs)/1 var(--mono); color: var(--faint); }
.hm-steps .is-now { color: var(--text); border-bottom: 2px solid var(--accent); }
.hm-steps .is-past { color: var(--muted); }
.hm-qtext, .hm-result-t { margin: 0; font-size: var(--fs-lg); line-height: 1.35; word-break: keep-all; }
.hm-sub { margin: 0; color: var(--muted); word-break: keep-all; }
.hm-dk { min-height: 48px; color: var(--muted); background: transparent; }
.hm-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* The keyboard: light keys, dark black keys. Orange = "press here" (is-mark) and lit / pressed (is-lit, is-hit). */
.hk { position: relative; display: flex; width: 100%; max-width: 40rem; height: clamp(112px, 30vw, 150px); margin: var(--s-2) 0; user-select: none; touch-action: manipulation; }
.hk-w { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; margin-right: 1px; padding: 0 0 var(--s-2); color: var(--bg); background: var(--text); border: 1px solid var(--control-border); border-radius: 0 0 var(--radius) var(--radius); font: 600 var(--fs-xs)/1 var(--mono); cursor: pointer; }
.hk-b { position: absolute; z-index: 2; top: 0; height: 62%; padding: 0; transform: translateX(-50%); background: var(--surface-3); border: 1px solid var(--bg); border-radius: 0 0 var(--radius) var(--radius); box-shadow: inset 0 -4px 0 var(--line-strong); cursor: pointer; }
.hk-w:focus-visible, .hk-b:focus-visible { z-index: 3; outline: 2px solid var(--accent); outline-offset: 1px; }
.hk-w.is-mark, .hk-b.is-mark { box-shadow: inset 0 -10px 0 var(--accent); }
.hk-w.is-lit, .hk-b.is-lit { color: var(--on-accent); background: var(--accent); }
.hk-w.is-hit, .hk-b.is-hit { color: var(--on-accent); background: var(--accent-hover); }

/* Hear and check controls */
.hk-plays { display: flex; flex-wrap: wrap; gap: var(--s-3); margin: var(--s-3) 0 0; }
.hk-play { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 52px; }
.hk-play.is-on { color: var(--accent); border-color: var(--accent); }
.hk-ico { font-size: .8em; }
.hk-opts { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); width: 100%; max-width: 40rem; margin: var(--s-4) 0 0; }
.hk-opt { min-height: 52px; justify-content: center; text-align: center; word-break: keep-all; }
.hk-opt.is-lit { color: var(--text); background: var(--accent-soft); border-color: var(--accent); }
.hk-opt:disabled { opacity: .45; }
.hk-src { max-width: 38rem; margin: var(--s-4) 0 0; font-size: var(--fs-xs); line-height: 1.5; color: var(--faint); }
.hk-src-h { color: var(--muted); }
@media (max-width: 480px) { .hk-opts { grid-template-columns: minmax(0, 1fr); } }
