/* ============================================================ FREE TOOLS — TRAINING ============================================================ */

/* ---- tools / training switch ---- */
.tm-ft-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 16px; padding: 4px; border-radius: 22px; background: rgba(16, 16, 20, 0.86); }
.tm-ft-mode a { position: relative; display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px 18px; border-radius: 18px; color: rgba(247, 242, 232, 0.5); text-decoration: none; transition: background 0.25s ease, color 0.25s ease; }
.tm-ft-mode a:hover { color: #fff; }
.tm-ft-mode a:focus { outline: none; }
.tm-ft-mode a:focus-visible { outline: 1px solid var(--primary); outline-offset: -1px; }
.tm-ft-mode a > i { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(247, 242, 232, 0.05); font-size: 15px; transition: background 0.25s ease, color 0.25s ease; }
.tm-ft-mode a > span { flex: 1; min-width: 0; }
.tm-ft-mode b { display: block; font-size: 17px; font-weight: 600; }
.tm-ft-mode small { display: block; margin-top: 2px; font-size: 12px; color: rgba(247, 242, 232, 0.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-ft-mode em { flex: none; padding: 2px 8px; border-radius: 999px; background: rgba(247, 242, 232, 0.07); font-family: var(--font-mono); font-size: 11px; font-style: normal; color: rgba(247, 242, 232, 0.6); }
.tm-ft-mode a.tm-active { background: rgba(247, 242, 232, 0.07); color: #fff; }
.tm-ft-mode a.tm-active > i { background: var(--primary); color: #fff; box-shadow: 0 0 18px var(--primary-dim); }
.tm-ft-mode a::after { content: ''; position: absolute; left: 18px; right: 18px; bottom: 0; height: 2px; border-radius: 2px; background: var(--primary); box-shadow: 0 0 10px var(--primary); transform: scaleX(0); transition: transform 0.35s cubic-bezier(.2,.8,.2,1); }
.tm-ft-mode a.tm-active::after { transform: scaleX(1); }
.tm-ft-page:not(.tm-mode-train) .tm-ft-rail-sec.tm-train,
.tm-ft-page.tm-mode-train .tm-ft-rail-sec:not(.tm-train),
.tm-ft-page.tm-mode-train .tm-ft-quick,
.tm-ft-page.tm-mode-train .tm-ft-rail-head:has(+ .tm-ft-quick),
.tm-ft-page.tm-mode-train .tm-ft-rail-legend { display: none; }
.tm-ft-page.tm-mode-train .tm-ft-quick + .tm-ft-rail-head { margin-top: 6px; padding-top: 0; border-top: none; }
.tm-ft-page.tm-mode-train .tm-ft-rail-sec + .tm-ft-rail-sec.tm-train { border-top: 1px solid rgba(247, 242, 232, 0.05); }
@media (max-width: 760px) {
  .tm-ft-mode { margin-bottom: 12px; border-radius: 20px; }
  .tm-ft-mode a { gap: 10px; padding: 10px 12px; border-radius: 16px; }
  .tm-ft-mode a > i { width: 36px; height: 36px; border-radius: 11px; font-size: 14px; }
  .tm-ft-mode b { font-size: 15px; }
  .tm-ft-mode small, .tm-ft-mode em { display: none; }
  .tm-ft-mode a::after { left: 12px; right: 12px; }
}

/* ---- your track: excerpt strip (the track itself lives in the dock) ---- */
.tm-ft-tr-file { margin-bottom: 14px; padding: 12px 14px 14px; border-radius: 16px; background: rgba(247, 242, 232, 0.04); }
.tm-ft-tr-file-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(247, 242, 232, 0.6); }
.tm-ft-tr-file-meta small { font-family: var(--font-text); font-size: 12px; letter-spacing: 0; text-transform: none; color: rgba(247, 242, 232, 0.4); }
.tm-ft-tr-over { display: block; width: 100%; height: 56px; cursor: grab; touch-action: none; }
.tm-ft-tr-over:active { cursor: grabbing; }
.tm-ft-dock.tm-train .tm-ft-dock-progress { pointer-events: none; }

/* ---- stage ---- */
.tm-ft-tr-stage { display: flex; flex-direction: column; padding: 20px 24px 22px; }
.tm-ft-tr-stage > * { position: relative; z-index: 1; }
.tm-ft-tr-lv button { min-width: 26px; }
.tm-ft-tr-lv button.tm-passed:not(.tm-active) { color: var(--primary); }
.tm-ft-tr-lv button:disabled { cursor: default; }
.tm-ft-tr-lv button:disabled:not(.tm-active) { opacity: 0.35; }
.tm-ft-tr-prog { display: grid; grid-template-columns: repeat(var(--n, 10), minmax(0, 1fr)); gap: 4px; margin-bottom: 26px; }
.tm-ft-tr-prog i { height: 3px; border-radius: 3px; background: rgba(247, 242, 232, 0.1); transition: background 0.3s ease, box-shadow 0.3s ease; }
.tm-ft-tr-prog i.tm-now { background: rgba(247, 242, 232, 0.5); }
.tm-ft-tr-prog i.tm-ok { background: var(--primary); box-shadow: 0 0 8px var(--primary-dim); }
.tm-ft-tr-prog i.tm-bad { background: rgba(247, 242, 232, 0.32); }
.tm-ft-tr-q { margin-bottom: 22px; }
.tm-ft-tr-q h3 { margin: 0; max-width: 34em; font-size: clamp(1.2rem, 2.3vw, 1.65rem); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.tm-ft-tr-q p { margin: 8px 0 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(247, 242, 232, 0.42); }
.tm-ft-tr-result { margin: 4px 0 24px; }
.tm-ft-tr-result strong { display: block; font-family: var(--font-mono); font-size: clamp(3.4rem, 9vw, 5.4rem); font-weight: 500; line-height: 1; letter-spacing: -0.03em; color: #fff; }
.tm-ft-tr-result strong small { font-size: 0.42em; color: rgba(247, 242, 232, 0.35); letter-spacing: 0; }
.tm-ft-tr-result p { margin: 12px 0 0; font-size: 15px; color: rgba(247, 242, 232, 0.7); }
.tm-ft-tr-stage kbd { display: inline-block; min-width: 18px; padding: 1px 5px; border-radius: 5px; background: rgba(247, 242, 232, 0.08); font-family: var(--font-mono); font-size: 10px; font-weight: 500; line-height: 1.5; text-align: center; color: rgba(247, 242, 232, 0.45); }
@media (pointer: coarse) { .tm-ft-tr-stage kbd { display: none; } }

/* ---- sounds: play + versions ---- */
.tm-ft-tr.tm-tr-busy .tm-ft-tr-sounds, .tm-ft-tr.tm-tr-busy .tm-ft-tr-ans { opacity: 0.4; pointer-events: none; }

/* ---- answers ---- */
.tm-ft-tr-ans { transition: opacity 0.2s ease; }
.tm-ft-tr-eq { border-radius: 14px; background: rgba(247, 242, 232, 0.03); overflow: hidden; }
.tm-ft-tr-eq canvas { display: block; width: 100%; height: 130px; }
.tm-ft-tr-bands, .tm-ft-tr-picks, .tm-ft-tr-chips { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 6px; }
.tm-ft-tr-bands { padding: 6px; }
.tm-ft-tr-bands button, .tm-ft-tr-picks button, .tm-ft-tr-chips button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 52px; padding: 8px 4px; border: none; border-radius: 10px; background: rgba(247, 242, 232, 0.06); color: rgba(247, 242, 232, 0.8); font: inherit; cursor: pointer; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.tm-ft-tr-bands button b { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.tm-ft-tr-bands button kbd, .tm-ft-tr-picks button kbd, .tm-ft-tr-chips button kbd { position: absolute; top: 5px; left: 5px; min-width: 0; padding: 0 4px; font-size: 9px; background: none; }
.tm-ft-tr-picks button { min-height: 76px; border-radius: 14px; }
.tm-ft-tr-picks button b { font-size: 22px; font-weight: 600; }
.tm-ft-tr-picks button small, .tm-ft-tr-chips button small { font-size: 11px; color: rgba(247, 242, 232, 0.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tm-ft-tr-chips button { min-height: 64px; border-radius: 12px; }
.tm-ft-tr-chips button b { font-family: var(--font-mono); font-size: 16px; font-weight: 600; }
.tm-ft-tr-ans button:hover { background: rgba(247, 242, 232, 0.12); color: #fff; }
.tm-ft-tr.tm-tr-answered .tm-ft-tr-ans :is(.tm-ft-tr-bands, .tm-ft-tr-picks, .tm-ft-tr-chips) button:not(.tm-ok):not(.tm-bad) { opacity: 0.45; }
.tm-ft-tr.tm-tr-answered .tm-ft-tr-ans :is(.tm-ft-tr-bands, .tm-ft-tr-picks, .tm-ft-tr-chips) button { cursor: default; }
.tm-ft-tr-ans button.tm-ok { background: var(--primary); color: #fff; box-shadow: 0 0 22px var(--primary-dim); opacity: 1; }
.tm-ft-tr-ans button.tm-bad { background: rgba(247, 242, 232, 0.16); color: #fff; opacity: 1; }
.tm-ft-tr-ans button.tm-ok small, .tm-ft-tr-ans button.tm-bad small { color: rgba(255, 255, 255, 0.8); }

/* ---- piano ---- */
.tm-ft-tr-piano { height: 176px; margin-top: 0; }
.tm-ft-tr-piano .tm-ft-tr-black-1 { left: calc(100% / 7 * 1); }
.tm-ft-tr-piano .tm-ft-tr-black-2 { left: calc(100% / 7 * 2); }
.tm-ft-tr-piano .tm-ft-tr-black-4 { left: calc(100% / 7 * 4); }
.tm-ft-tr-piano .tm-ft-tr-black-5 { left: calc(100% / 7 * 5); }
.tm-ft-tr-piano .tm-ft-tr-black-6 { left: calc(100% / 7 * 6); }
.tm-ft-tr-piano button.tm-off { opacity: 0.22; pointer-events: none; }
.tm-ft-tr-piano button.tm-ok, .tm-ft-tr-piano button.tm-ok:hover { background: var(--primary); color: #fff; box-shadow: 0 0 22px var(--primary-dim); }
.tm-ft-tr-piano .tm-ft-tu-white.tm-bad, .tm-ft-tr-piano .tm-ft-tu-white.tm-bad:hover { background: #77746e; color: #fff; }
.tm-ft-tr-piano .tm-ft-tu-black.tm-bad, .tm-ft-tr-piano .tm-ft-tu-black.tm-bad:hover { background: #4a4844; color: #fff; }

/* ---- foot ---- */
.tm-ft-tr-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 12px; margin-top: 20px; }
.tm-ft-tr-msg { flex: 1 1 260px; min-height: 1.4em; margin: 0; font-size: 14px; color: rgba(247, 242, 232, 0.6); }
.tm-ft-tr-msg.tm-ok { color: #fff; }
.tm-ft-tr-msg.tm-ok::before, .tm-ft-tr-msg.tm-bad::before { content: ''; display: inline-block; width: 7px; height: 7px; margin: 0 9px 1px 0; border-radius: 50%; background: var(--primary); box-shadow: 0 0 8px var(--primary); }
.tm-ft-tr-msg.tm-bad::before { background: rgba(247, 242, 232, 0.5); box-shadow: none; }
.tm-ft-tr-msg.tm-err { color: var(--red); }
.tm-ft-tr-foot .tm-ft-btn { padding: 13px 22px; }
.tm-ft-tr-go { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 46px; padding: 0 20px 0 22px; border: none; border-radius: 999px; background: rgba(247, 242, 232, 0.09); color: #fff; font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; transition: background 0.2s ease; }
.tm-ft-tr-go i { font-size: 11px; color: var(--primary); }
.tm-ft-tr-go:hover { background: rgba(247, 242, 232, 0.15); }
.tm-ft-tr-go:disabled { opacity: 0.35; pointer-events: none; }
.tm-ft-tr.tm-tr-answered .tm-ft-tr-go { background: var(--primary-dim); }

/* ---- motion ---- */
.tm-ft-tr-q h3.tm-swap { animation: tm-tr-swap 0.45s cubic-bezier(.2,.7,.2,1); }
@keyframes tm-tr-swap { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.tm-ft-tr-prog i.tm-ok, .tm-ft-tr-prog i.tm-bad { transform-origin: left; animation: tm-tr-fill 0.4s cubic-bezier(.2,.8,.2,1); }
@keyframes tm-tr-fill { from { transform: scaleX(0); } }
.tm-ft-tr-ans .tm-ok { animation: tm-tr-pop 0.5s cubic-bezier(.2,.9,.3,1.3); }
.tm-ft-tr-ans .tm-bad { animation: tm-tr-shake 0.42s ease; }
@keyframes tm-tr-pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes tm-tr-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.tm-ft-tr-black-1.tm-ok, .tm-ft-tr-black-2.tm-ok, .tm-ft-tr-black-4.tm-ok, .tm-ft-tr-black-5.tm-ok, .tm-ft-tr-black-6.tm-ok, .tm-ft-tr-piano .tm-ft-tu-black.tm-bad { animation: none; }
.tm-ft-tr-piano button.tm-tap { animation: tm-tr-tap 0.35s ease; }
@keyframes tm-tr-tap { 50% { box-shadow: inset 0 -6px 0 var(--primary), 0 0 20px var(--primary-dim); } }
.tm-ft-tr-result strong.tm-pass { color: var(--primary); text-shadow: 0 0 30px var(--primary-dim); }
.tm-ft-tr-result { animation: tm-tr-swap 0.5s cubic-bezier(.2,.7,.2,1); }
@media (prefers-reduced-motion: reduce) { .tm-ft-tr *, .tm-ft-tr-lib { animation: none !important; } }

/* ---- playing tile: little equaliser ---- */
.tm-ft-tr-eqz { grid-column: 2; grid-row: 2; justify-self: end; align-self: end; display: none; gap: 2px; height: 12px; align-items: flex-end; }
.tm-ft-tr-eqz i { width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform-origin: bottom; animation: tm-tr-eqz 0.9s ease-in-out infinite; }
.tm-ft-tr-eqz i:nth-child(2) { animation-delay: -0.3s; }
.tm-ft-tr-eqz i:nth-child(3) { animation-delay: -0.6s; }
@keyframes tm-tr-eqz { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }

/* ---- lock in ---- */
.tm-ft-tr-go.tm-lock { background: var(--primary); box-shadow: 0 0 22px var(--primary-dim); }
.tm-ft-tr-go.tm-lock i { color: #fff; }
.tm-ft-tr-go.tm-lock:disabled { opacity: 1; background: rgba(247, 242, 232, 0.06); box-shadow: none; color: rgba(247, 242, 232, 0.35); }
.tm-ft-tr-go.tm-lock:disabled i { color: inherit; }

/* ---- EQ canvases ---- */
.tm-ft-tr-eq--free { margin-bottom: 8px; }
.tm-ft-tr-eq--free canvas { height: 150px; }
.tm-ft-tr-match { position: relative; }
.tm-ft-tr-match canvas { height: 230px; cursor: grab; touch-action: none; }
.tm-ft-tr-match canvas:active { cursor: grabbing; }
.tm-ft-tr-hint { position: absolute; left: 50%; bottom: 14px; margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(247, 242, 232, 0.08); font-size: 12px; color: rgba(247, 242, 232, 0.7); transform: translateX(-50%); pointer-events: none; animation: tm-tr-hint 1.8s ease-in-out infinite; transition: opacity 0.3s ease; }
@keyframes tm-tr-hint { 50% { transform: translateX(-50%) translateY(-3px); } }
.tm-ft-tr-match.tm-touched .tm-ft-tr-hint { opacity: 0; }
.tm-ft-tr-match.tm-ok { box-shadow: inset 0 0 0 1px var(--primary); }
.tm-ft-tr-match.tm-bad { box-shadow: inset 0 0 0 1px rgba(247, 242, 232, 0.3); }
.tm-ft-tr-bands.tm-dense { grid-template-columns: repeat(8, minmax(0, 1fr)); }

/* ---- up / down ---- */
.tm-ft-tr-updown button { flex-direction: row; gap: 12px; min-height: 64px; }
.tm-ft-tr-updown button > i { font-size: 18px; transition: transform 0.3s cubic-bezier(.2,.8,.2,1); }
.tm-ft-tr-updown button:hover > i { transform: translateY(-3px); }
.tm-ft-tr-updown button[data-i="1"]:hover > i { transform: translateY(3px); }
.tm-ft-tr-updown button b { font-size: 18px; }

/* ---- level meters ---- */
.tm-ft-tr-picks button .tm-ft-tr-meter { width: 70%; height: 4px; margin-top: 8px; border-radius: 4px; background: rgba(247, 242, 232, 0.08); overflow: hidden; }
.tm-ft-tr-picks button .tm-ft-tr-meter i { display: block; height: 100%; width: calc(var(--lvl, 0) * 100%); border-radius: 4px; background: currentColor; transition: width 0.7s cubic-bezier(.2,.8,.2,1); }
.tm-ft-tr-picks button em { min-height: 1.2em; font-family: var(--font-mono); font-size: 11px; font-style: normal; color: inherit; opacity: 0.85; }

/* ---- compression waveforms ---- */
.tm-ft-tr-waves { display: block; width: 100%; height: 96px; margin-top: 10px; border-radius: 12px; background: rgba(247, 242, 232, 0.03); }
.tm-ft-tr:not(.tm-tr-answered) .tm-ft-tr-waves { display: none; }

/* ---- stereo field ---- */
.tm-ft-tr-picks--tall button { min-height: 0; padding: 10px 6px 12px; }
.tm-ft-tr-gonio { display: block; width: 100%; max-width: 160px; height: 0; margin-top: 0; transition: height 0.45s cubic-bezier(.2,.8,.2,1), margin 0.45s ease; }
.tm-ft-tr.tm-tr-answered .tm-ft-tr-gonio { height: 110px; margin-top: 8px; }

/* ---- pan stage ---- */
.tm-ft-tr-stagepan { border-radius: 14px; background: rgba(247, 242, 232, 0.03); padding: 8px 8px 0; }
.tm-ft-tr-stagepan svg { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; overflow: visible; }
.tm-pan-arc { fill: none; stroke: rgba(247, 242, 232, 0.14); stroke-width: 2; stroke-dasharray: 3 6; }
.tm-pan-arc--r1 { stroke: rgba(247, 242, 232, 0.06); }
.tm-pan-spk rect { fill: rgba(247, 242, 232, 0.1); }
.tm-pan-spk circle { fill: none; stroke: rgba(247, 242, 232, 0.4); stroke-width: 1.5; }
.tm-pan-spk text, .tm-pan-dot text { fill: rgba(247, 242, 232, 0.5); font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-anchor: middle; }
.tm-pan-head circle { fill: #1c1c22; stroke: rgba(247, 242, 232, 0.35); stroke-width: 1.5; }
.tm-pan-head path { fill: rgba(247, 242, 232, 0.35); }
.tm-pan-head .tm-pan-ear { fill: rgba(247, 242, 232, 0.35); stroke: none; }
.tm-ft-tr.tm-playing .tm-pan-ear { animation: tm-pan-ear 0.9s ease-in-out infinite; }
@keyframes tm-pan-ear { 50% { fill: var(--primary); } }
.tm-pan-dot { cursor: pointer; outline: none; }
.tm-pan-hit { fill: transparent; }
.tm-pan-ring { fill: none; stroke: rgba(247, 242, 232, 0.12); stroke-width: 1.5; transform: scale(0.6); transition: transform 0.25s cubic-bezier(.2,.8,.2,1), stroke 0.2s ease; }
.tm-pan-core { fill: rgba(247, 242, 232, 0.55); transition: fill 0.2s ease, r 0.2s ease; }
.tm-ft-tr.tm-tr-round .tm-pan-dot:hover .tm-pan-ring, .tm-pan-dot:focus-visible .tm-pan-ring { transform: scale(1); stroke: var(--primary); }
.tm-ft-tr.tm-tr-round .tm-pan-dot:hover .tm-pan-core { fill: #fff; }
.tm-pan-dot.tm-ok .tm-pan-core { fill: var(--primary); r: 9; }
.tm-pan-dot.tm-ok .tm-pan-ring { transform: scale(1.15); stroke: var(--primary); }
.tm-pan-dot.tm-ok text { fill: var(--primary); }
.tm-pan-dot.tm-bad .tm-pan-core { fill: rgba(247, 242, 232, 0.85); }
.tm-pan-dot.tm-bad text { fill: rgba(247, 242, 232, 0.85); }
.tm-ft-tr-ans .tm-pan-dot.tm-ok, .tm-ft-tr-ans .tm-pan-dot.tm-bad { animation: none; }
.tm-pan-ray { stroke: var(--primary); stroke-width: 2; stroke-linecap: round; opacity: 0; transition: opacity 0.2s ease; }
.tm-pan-ray.tm-on { opacity: 0.7; stroke-dasharray: 220; stroke-dashoffset: 220; animation: tm-pan-ray 0.6s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes tm-pan-ray { to { stroke-dashoffset: 0; } }
.tm-pan-waves circle { fill: none; stroke: var(--primary); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: tm-pan-wave 1.6s ease-out infinite; }
.tm-pan-waves circle + circle { animation-delay: 0.8s; }
@keyframes tm-pan-wave { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(2.4); opacity: 0; } }

/* ---- Two Minds tracks ---- */
.tm-ft-tr-lib { position: fixed; right: var(--lib-right, 24px); bottom: var(--lib-bottom, 90px); z-index: 455; width: min(340px, calc(100vw - 32px)); padding: 8px; border-radius: 22px; background: #141418; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7); transform-origin: bottom right; animation: tm-tr-lib 0.28s cubic-bezier(.2,.8,.2,1); }
@keyframes tm-tr-lib { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
.tm-ft-tr-lib-head { padding: 10px 12px 10px; }
.tm-ft-tr-lib-head b { display: block; font-size: 14px; font-weight: 600; }
.tm-ft-tr-lib-head small { display: block; margin-top: 2px; font-size: 12px; color: rgba(247, 242, 232, 0.45); }
.tm-ft-tr-lib button { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: none; border-radius: 14px; background: none; color: #fff; font: inherit; text-align: left; cursor: pointer; transition: background 0.2s ease; }
.tm-ft-tr-lib button:hover { background: rgba(247, 242, 232, 0.06); }
.tm-ft-tr-lib img { flex: none; width: 48px; height: 48px; border-radius: 8px; object-fit: cover; transition: transform 0.3s cubic-bezier(.2,.8,.2,1); }
.tm-ft-tr-lib button:hover img { transform: scale(1.06) rotate(-2deg); }
.tm-ft-tr-lib span { flex: 1; min-width: 0; }
.tm-ft-tr-lib span b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-ft-tr-lib span small { display: block; margin-top: 2px; font-size: 12px; color: rgba(247, 242, 232, 0.45); }
.tm-ft-tr-lib button > i { display: none; color: var(--primary); }
.tm-ft-tr-lib button.tm-current > i { display: block; }
.tm-ft-tr-lib button.tm-current { background: rgba(247, 242, 232, 0.05); }
.tm-ft-tr-lib em { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(247, 242, 232, 0.2); border-top-color: var(--primary); animation: tm-tr-spin 0.7s linear infinite; }
.tm-ft-tr-lib button.tm-busy em { display: block; }
.tm-ft-tr-lib button.tm-busy > i { display: none; }
@keyframes tm-tr-spin { to { transform: rotate(360deg); } }
.tm-ft-dock-lib { display: none; }
.tm-ft-dock.tm-train .tm-ft-dock-lib { display: grid; }
.tm-ft-dock.tm-train .tm-ft-dock-tools { overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.tm-ft-dock.tm-train .tm-ft-dock-tools::-webkit-scrollbar { display: none; }


/* ---- listen: play + sliding A / B / C switch ---- */
.tm-ft-tr-sounds { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; transition: opacity 0.2s ease; }
.tm-ft-tr-play { flex: none; display: grid; place-items: center; width: 58px; height: 58px; border: none; border-radius: 50%; background: rgba(247, 242, 232, 0.1); color: #fff; cursor: pointer; transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease; }
.tm-ft-tr-play:hover { background: rgba(247, 242, 232, 0.16); }
.tm-ft-tr-play:active { transform: scale(0.95); }
.tm-ft-tr-play svg { width: 15px; height: 15px; fill: currentColor; }
.tm-ft-tr-play svg + svg, .tm-ft-tr.tm-playing .tm-ft-tr-play svg:first-child { display: none; }
.tm-ft-tr.tm-playing .tm-ft-tr-play svg + svg { display: block; }
.tm-ft-tr.tm-playing .tm-ft-tr-play { background: var(--primary); box-shadow: 0 0 22px var(--primary-dim); }
.tm-ft-tr-switch { position: relative; flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); height: 58px; padding: 4px; border-radius: 999px; background: rgba(247, 242, 232, 0.06); }
.tm-ft-tr-thumb { position: absolute; top: 4px; bottom: 4px; left: calc(4px + var(--i, 0) * (100% - 8px) / var(--n, 2)); width: calc((100% - 8px) / var(--n, 2)); border-radius: 999px; background: rgba(247, 242, 232, 0.13); transition: left 0.42s cubic-bezier(.3,1.35,.5,1), background 0.25s ease, box-shadow 0.25s ease; }
.tm-ft-tr-switch.tm-live .tm-ft-tr-thumb { background: var(--primary); box-shadow: 0 0 24px var(--primary-dim); }
.tm-ft-tr-switch button { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; padding: 0 10px; border: none; border-radius: 999px; background: none; color: rgba(247, 242, 232, 0.5); font: inherit; cursor: pointer; transition: color 0.25s ease; }
.tm-ft-tr-switch button:hover { color: #fff; }
.tm-ft-tr-switch button b { font-size: 15px; font-weight: 600; }
.tm-ft-tr-switch button small { max-width: 100%; font-size: 11px; color: inherit; opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-ft-tr-switch button.tm-sel { color: #fff; }
.tm-ft-tr-switch button.tm-target:not(.tm-on) small { color: var(--primary); opacity: 1; }
.tm-ft-tr-switch .tm-ft-tr-eqz { position: absolute; right: 16px; top: 50%; margin-top: -6px; }
.tm-ft-tr-switch button.tm-on .tm-ft-tr-eqz { display: inline-flex; }
.tm-ft-tr-switch button:focus-visible { outline: 1px solid var(--primary); outline-offset: -3px; }

/* ---- synth cues ---- */
.tm-ft-tr-sounds:not(:has(.tm-ft-tr-switch)) { flex-wrap: wrap; gap: 8px; }
.tm-ft-tr-cue { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 18px 6px 6px; border: none; border-radius: 999px; background: rgba(247, 242, 232, 0.06); color: rgba(247, 242, 232, 0.8); font: inherit; cursor: pointer; transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease; }
.tm-ft-tr-cue > i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(247, 242, 232, 0.1); font-size: 13px; }
.tm-ft-tr-cue b { font-size: 14px; font-weight: 600; }
.tm-ft-tr-cue small { min-width: 0; font-size: 12px; color: rgba(247, 242, 232, 0.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-ft-tr-cue kbd { margin-left: 4px; }
.tm-ft-tr-cue:hover { background: rgba(247, 242, 232, 0.1); color: #fff; }
.tm-ft-tr-cue.tm-on { background: var(--primary); color: #fff; box-shadow: 0 0 22px var(--primary-dim); }
.tm-ft-tr-cue.tm-on > i { background: rgba(0, 0, 0, 0.18); }
.tm-ft-tr-cue.tm-on small { color: rgba(255, 255, 255, 0.8); }
.tm-ft-tr-cue .tm-ft-tr-eqz { grid-column: auto; grid-row: auto; align-self: center; }
.tm-ft-tr-cue.tm-on .tm-ft-tr-eqz { display: inline-flex; }
.tm-ft-tr-cue.tm-on kbd { display: none; }

/* ---- type pickers on a canvas: boost / cut, low / high ---- */
.tm-ft-tr-type { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 8px; padding: 4px; border-radius: 16px; background: rgba(247, 242, 232, 0.04); }
.tm-ft-tr-type button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 14px; border: none; border-radius: 12px; background: none; color: rgba(247, 242, 232, 0.6); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.2s ease, color 0.2s ease; }
.tm-ft-tr-type button:hover { color: #fff; }
.tm-ft-tr-type button.tm-sel { background: rgba(247, 242, 232, 0.16); color: #fff; }
.tm-ft-tr-type button.tm-ok { background: var(--primary); color: #fff; }
.tm-ft-tr-type button.tm-bad { background: rgba(247, 242, 232, 0.16); color: rgba(255, 255, 255, 0.85); }
.tm-ft-tr-type:not(:has(.tm-sel, .tm-ok)) { animation: tm-tr-ask 1.6s ease-in-out infinite; }
@keyframes tm-tr-ask { 50% { box-shadow: 0 0 0 4px var(--primary-dim); } }


.tm-ft-tr-eq { position: relative; }
.tm-ft-tr-type svg { width: 22px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tm-ft-tr-type.tm-nudge { animation: tm-tr-shake 0.42s ease; }
.tm-ft-tr-ans:has(> .tm-ft-tr-type) .tm-ft-tr-bands:not(.tm-armed) button { opacity: 0.45; }
.tm-ft-tr-ans:has(> .tm-ft-tr-type) .tm-ft-tr-bands button { transition: opacity 0.3s ease, background 0.2s ease, color 0.2s ease; }

/* ---- no track yet ---- */
.tm-ft-tr-empty { margin-bottom: 14px; }
.tm-ft-tr-drop { min-height: 180px; }
.tm-ft-tr-quick { margin-top: 10px; padding: 12px; border-radius: 16px; background: rgba(247, 242, 232, 0.04); }
.tm-ft-tr-quick small { display: block; margin: 0 4px 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(247, 242, 232, 0.45); }
.tm-ft-tr-quick > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tm-ft-tr-quick button { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 12px 6px 6px; border: none; border-radius: 12px; background: rgba(247, 242, 232, 0.05); color: #fff; font: inherit; text-align: left; cursor: pointer; transition: background 0.2s ease, transform 0.2s ease; }
.tm-ft-tr-quick button:hover { background: rgba(247, 242, 232, 0.1); transform: translateY(-1px); }
.tm-ft-tr-quick img { flex: none; width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.tm-ft-tr-quick b { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-ft-tr-quick em { display: none; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(247, 242, 232, 0.2); border-top-color: var(--primary); animation: tm-tr-spin 0.7s linear infinite; }
.tm-ft-tr-quick button.tm-busy em { display: block; }
.tm-ft-tr-empty.tm-busy .tm-ft-tr-drop { opacity: 0.5; pointer-events: none; }

/* ---- share the score ---- */
.tm-ft-tr-share { display: inline-flex; align-items: center; gap: 9px; min-height: 46px; padding: 0 18px; border: none; border-radius: 999px; background: rgba(247, 242, 232, 0.06); color: #fff; font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; transition: background 0.2s ease; }
.tm-ft-tr-share i { color: var(--primary); }
.tm-ft-tr-share:hover { background: rgba(247, 242, 232, 0.12); }

/* ---- waveform ---- */
.tm-ft-tr-scope { display: block; width: 100%; height: 0; margin-bottom: 0; border-radius: 12px; background: rgba(247, 242, 232, 0.03); transition: height 0.4s cubic-bezier(.2,.8,.2,1), margin 0.4s ease; }
.tm-ft-tr.tm-tr-answered .tm-ft-tr-scope { height: 110px; margin-bottom: 10px; }
.tm-ft-tr-wavepicks button { min-height: 96px; gap: 6px; }
.tm-ft-tr-wavepicks svg { width: 48px; height: 24px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s cubic-bezier(.2,.8,.2,1); }
.tm-ft-tr-wavepicks button:hover svg { transform: scaleX(1.12); }
.tm-ft-tr-wavepicks button b { font-size: 14px; }

/* ---- envelope ---- */
.tm-ft-tr-adsr canvas { height: 250px; }
.tm-ft-tr-adsr .tm-ft-tr-hint { top: 12px; right: 12px; bottom: auto; left: auto; transform: none; animation: none; }


/* ---- step 1: pick a track, step 2: the exercise ---- */
.tm-ft-tr.tm-tr-notrack .tm-ft-tr-stage, .tm-ft-tr.tm-tr-notrack > .tm-ft-fine { display: none; }
.tm-ft-tr:not(.tm-tr-notrack) .tm-ft-tr-stage { animation: tm-tr-swap 0.5s cubic-bezier(.2,.7,.2,1); }
.tm-ft-tr-empty { animation: tm-tr-swap 0.4s cubic-bezier(.2,.7,.2,1); }

/* ---- stop ---- */
.tm-ft-tr-quit { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border: none; border-radius: 999px; background: rgba(247, 242, 232, 0.06); color: rgba(247, 242, 232, 0.55); font: inherit; font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; transition: background 0.2s ease, color 0.2s ease; }
.tm-ft-tr-quit i { font-size: 10px; }
.tm-ft-tr-quit:hover { background: rgba(247, 242, 232, 0.12); color: #fff; }
@media (pointer: coarse) { .tm-ft-tr-quit { min-height: 34px; padding: 0 12px; } }


/* ---- listen above, answer below ---- */
.tm-ft-tr-ans::before { content: 'Your answer'; display: flex; align-items: center; gap: 12px; margin: 2px 0 14px; font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(247, 242, 232, 0.35); }
.tm-ft-tr-ans::after { content: none; }
.tm-ft-tr-sounds { position: relative; padding-bottom: 18px; margin-bottom: 16px; }
.tm-ft-tr-sounds::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(247, 242, 232, 0.12) 12%, rgba(247, 242, 232, 0.12) 88%, transparent); }

/* ---- final exam ---- */
.tm-ft-rail-exam { margin-top: 8px; padding: 14px 12px; border-radius: 14px; background: linear-gradient(120deg, var(--primary-dim), rgba(247, 242, 232, 0.03) 70%); color: #fff; }
.tm-ft-rail-exam .tm-ft-rail-idx { font-size: 9px; letter-spacing: 0.12em; color: var(--primary); }
.tm-ft-rail-exam .tm-ft-rail-desc { color: rgba(247, 242, 232, 0.6); }
.tm-ft-rail-exam:hover { color: #fff; filter: brightness(1.15); }
.tm-ft-rail-exam.tm-active { background: linear-gradient(120deg, var(--primary), var(--primary-dim)); }
.tm-ft-rail-exam.tm-active .tm-ft-rail-idx, .tm-ft-rail-exam.tm-active .tm-ft-rail-desc { color: rgba(255, 255, 255, 0.85); }
.tm-ft-page:not(.tm-mode-train) .tm-ft-rail-exam { display: none; }
.tm-ft-exam-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.tm-ft-exam-list li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: rgba(247, 242, 232, 0.04); animation: tm-tr-swap 0.4s cubic-bezier(.2,.7,.2,1) backwards; }
.tm-ft-exam-list li:nth-child(2n) { animation-delay: 0.03s; } .tm-ft-exam-list li:nth-child(3n) { animation-delay: 0.06s; }
.tm-ft-exam-list li i { flex: none; font-size: 7px; color: rgba(247, 242, 232, 0.3); }
.tm-ft-exam-list li b { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-ft-exam-list li small { flex: none; font-family: var(--font-mono); font-size: 10px; color: rgba(247, 242, 232, 0.45); }
.tm-ft-exam-list li.tm-off { opacity: 0.35; }
.tm-ft-exam-list li.tm-ok { background: var(--primary-dim); }
.tm-ft-exam-list li.tm-ok i { font-size: 11px; color: #fff; }
.tm-ft-exam-list li.tm-bad i { font-size: 11px; color: rgba(247, 242, 232, 0.6); }
.tm-ft-exam-stage .tm-ft-tr-foot { margin-top: 22px; }

/* ---- phone ---- */
@media (max-width: 760px) {
  .tm-ft-tr-stage { padding: 16px 16px 18px; }
  .tm-ft-tr-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tm-ft-tr-bands { gap: 4px; padding: 0 4px 4px; }
  .tm-ft-tr-bands button { min-height: 48px; padding: 6px 2px; }
  .tm-ft-tr-bands button b { font-size: 12px; }
  .tm-ft-tr-eq canvas { height: 150px; }
  .tm-ft-tr-match canvas { height: 230px; }
  .tm-ft-tr-bands.tm-dense { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tm-ft-tr-lib { left: 16px; right: 16px; width: auto; }
  .tm-ft-tr-sounds { gap: 8px; }
  .tm-ft-tr-play { display: none; }
  .tm-ft-tr-switch { height: 52px; }
  .tm-ft-tr-switch button { padding: 0 6px; }
  .tm-ft-tr-switch button b { font-size: 14px; }
  .tm-ft-tr-switch .tm-ft-tr-eqz { display: none !important; }
  .tm-ft-tr-cue { flex: 1; }
  .tm-ft-tr-quick > div { grid-template-columns: 1fr; }
  .tm-ft-tr-drop { min-height: 150px; }
  .tm-ft-tr-wavepicks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tm-ft-tr-adsr canvas { height: 260px; }
  .tm-pan-dot text, .tm-pan-spk text { font-size: 14px; }
  .tm-ft-tr-stagepan { padding: 4px 0 0; }
  .tm-ft-tr-share { flex: 1; justify-content: center; }
  .tm-ft-exam-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-ft-exam-list li { gap: 8px; padding: 0 10px; }
  .tm-ft-exam-list li b { font-size: 12px; }
  .tm-ft-exam-list li small { display: none; }
  .tm-ft-tr-foot { margin-top: 16px; }
  .tm-ft-tr-msg { flex-basis: 100%; }
  .tm-ft-tr-foot .tm-ft-btn, .tm-ft-tr-go { flex: 1; }
}

/* ---- desktop: a bit more air ---- */
@media (min-width: 1101px) {
  .tm-ft-mode { margin-bottom: 28px; }
  .tm-ft-tr-stage { padding: 26px 30px 28px; }
  .tm-ft-tr-prog { margin-bottom: 32px; }
  .tm-ft-tr-q { margin-bottom: 28px; }
  .tm-ft-tr-sounds { padding-bottom: 22px; margin-bottom: 20px; }
  .tm-ft-tr-foot { margin-top: 26px; }
  .tm-ft-tr-file, .tm-ft-tr-empty { margin-bottom: 20px; }
}
