/* ============================================================ 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(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: var(--secondary); }
.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-sounds { display: flex; gap: 8px; margin-bottom: 16px; transition: opacity 0.2s ease; }
.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; }
.tm-ft-tr-play { flex: none; display: flex; align-items: center; justify-content: center; width: 72px; border: none; border-radius: 14px; background: rgba(247, 242, 232, 0.08); color: #fff; cursor: pointer; transition: background 0.2s ease; }
.tm-ft-tr-play:hover { background: rgba(247, 242, 232, 0.14); }
.tm-ft-tr-play svg { width: 14px; height: 14px; 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-v { position: relative; flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 10px; min-height: 72px; padding: 14px 16px; border: none; border-radius: 14px; background: rgba(247, 242, 232, 0.05); color: rgba(247, 242, 232, 0.75); font: inherit; text-align: left; cursor: pointer; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.tm-ft-tr-v:hover { background: rgba(247, 242, 232, 0.09); color: #fff; }
.tm-ft-tr-v b { grid-column: 1; grid-row: 1; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.tm-ft-tr-v kbd { grid-column: 2; grid-row: 1; }
.tm-ft-tr-v small { grid-column: 1 / -1; font-size: 12px; color: rgba(247, 242, 232, 0.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-ft-tr-v.tm-on { background: var(--primary); color: #fff; box-shadow: 0 0 24px var(--primary-dim); }
.tm-ft-tr-v.tm-on small, .tm-ft-tr-v.tm-on kbd { color: rgba(255, 255, 255, 0.8); }
.tm-ft-tr-v.tm-on kbd { background: rgba(0, 0, 0, 0.18); }
.tm-ft-tr-v.tm-target:not(.tm-on) { box-shadow: inset 0 0 0 1px var(--primary); }
.tm-ft-tr-v.tm-target small { color: var(--primary); }
.tm-ft-tr-v.tm-on.tm-target small { color: #fff; }

/* ---- 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: 0 6px 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: var(--secondary); 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 button.tm-bad, .tm-ft-tr-piano button.tm-bad:hover { background: var(--secondary); 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: var(--secondary); box-shadow: 0 0 8px var(--secondary); }
.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); } }
.tm-ft-tr-v.tm-on .tm-ft-tr-eqz { display: inline-flex; }
.tm-ft-tr-v.tm-on small { grid-column: 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 var(--secondary); }
.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: var(--secondary); }
.tm-pan-dot.tm-bad text { fill: var(--secondary); }
.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; }

/* ---- phone ---- */
@media (max-width: 760px) {
  .tm-ft-tr-stage { padding: 16px 16px 18px; }
  .tm-ft-tr-play { width: 56px; }
  .tm-ft-tr-v { min-height: 64px; padding: 12px; }
  .tm-ft-tr-v b { font-size: 16px; }
  .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: 110px; }
  .tm-ft-tr-match canvas { height: 210px; }
  .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.tm-many { gap: 6px; }
  .tm-ft-tr-sounds.tm-many .tm-ft-tr-play { width: 48px; }
  .tm-ft-tr-sounds.tm-many .tm-ft-tr-v { padding: 10px; }
  .tm-ft-tr-sounds.tm-many .tm-ft-tr-v b { font-size: 14px; }
  .tm-ft-tr-sounds.tm-many .tm-ft-tr-v small { font-size: 11px; }
  .tm-ft-tr-v .tm-ft-tr-eqz { position: absolute; top: 10px; right: 10px; }
  .tm-ft-tr-v.tm-on small { grid-column: 1 / -1; }
  .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; }
}
