/* Private BPM console. Scoped to preserve every other tool. */
.hk-bpm-detector{--bpm-line:#34474f;--bpm-muted:#c3d0d5}
.hk-bpm-detector .skip-link:not(:focus){position:fixed;top:0;left:-10000px;transform:none}
.hk-bpm-detector main{padding-top:18px}.hk-bpm-detector main>.wrap:first-child{padding-top:0}
.hk-bpm-detector .studio-toolbar{margin-bottom:16px;padding-bottom:12px}
.hk-bpm-detector .tool-header{margin-bottom:18px;padding-bottom:16px}
.hk-bpm-detector .tool-header h1{font-size:clamp(1.75rem,3.4vw,2.4rem);line-height:1.18;margin-bottom:10px}
.hk-bpm-detector .tool-header .hk-workspace-category{margin:0 0 8px}
.hk-bpm-detector .tool-header .tool-intro{font-size:1rem;line-height:1.5}
.hk-bpm-detector .tool-panel.bpm-console{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(260px,1fr);gap:0;padding:0;margin:0 0 16px;overflow:hidden;border:1px solid var(--bpm-line);border-radius:12px;background:#17242b;box-shadow:none}
.bpm-console-source,.bpm-console-result{min-width:0;padding:22px}
.bpm-console-result{background:#111d23;border-left:1px solid var(--bpm-line)}
.hk-bpm-detector .bpm-console-source>label{display:block;font-size:1rem;font-weight:600;color:#edf4f5;margin:0 0 8px}
.hk-bpm-detector .bpm-file-hint{font-size:.85rem;line-height:1.55;color:var(--bpm-muted);margin:0 0 12px;max-width:none}
.hk-bpm-detector .hk-file-limits{display:none}
.hk-bpm-detector .bpm-console .hk-file-field{padding:0;border:0;margin:0;background:transparent;min-width:0}
.hk-bpm-detector #session-file{display:block;width:100%;box-sizing:border-box;font:inherit;font-size:.9rem;color:#d7e5e8;background:#101a20;border:1px solid var(--bpm-line);border-radius:7px;padding:7px;min-height:46px;margin:0}
.hk-bpm-detector #session-file::file-selector-button{background:#253943;color:#eef7f8;border:1px solid #47616c;border-radius:4px;padding:8px 10px;margin-right:10px;font:inherit;cursor:pointer}
.hk-bpm-detector .bpm-example{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;margin:12px 0 14px;padding:0;border:0;border-radius:0}
.hk-bpm-detector .bpm-example>span{font-size:.8rem;line-height:1.4;color:var(--bpm-muted)}
.hk-bpm-detector .bpm-example button{min-height:44px;font-size:.85rem;padding:8px 12px;margin:0}
.bpm-console-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.hk-bpm-detector .bpm-console-actions .btn{min-height:44px;margin:0}
.hk-bpm-detector #bpm-example-status{font-size:.85rem;color:var(--bpm-muted);margin:0 0 12px}
.hk-bpm-detector #bpm-example-status:empty{display:none}
.hk-bpm-detector .bpm-console .readout-label{font:inherit;font-size:.9rem;font-weight:600;color:var(--bpm-muted);margin:0}
.hk-bpm-detector .bpm-console #session-result{font-variant-numeric:tabular-nums;font-family:'IBM Plex Sans',sans-serif;font-size:clamp(2.2rem,4vw,3.25rem);line-height:1.2;font-weight:500;letter-spacing:-.03em;white-space:nowrap;margin:12px 0;color:#69d2ce}
.bpm-result-hint{font-size:.9rem;line-height:1.6;color:var(--bpm-muted);margin:0}
.bpm-console:has(#rhythm-details:not([hidden])) .bpm-result-hint,.bpm-console:has(.hk-file-activity:not([hidden])) .bpm-result-hint{display:none}
.hk-bpm-detector #rhythm-details{display:block;margin:12px 0 0}.hk-bpm-detector .bpm-reading-detail{border-top:1px solid var(--bpm-line);padding:4px 0}
.hk-bpm-detector .bpm-reading-detail>summary{cursor:pointer;min-height:44px;align-content:center;font-size:.9rem;font-weight:600}
.hk-bpm-detector .bpm-reading-detail p{font-size:.9rem;margin:8px 0 12px;line-height:1.65}
.hk-bpm-detector .bpm-console .hk-source-preview{margin:12px 0}
.hk-bpm-detector .bpm-console .hk-source-label{font-size:.8rem;overflow-wrap:anywhere;margin:0 0 6px;color:var(--bpm-muted)}
.hk-bpm-detector .bpm-console .hk-audio-player{margin:0;background:#101a20;border-color:var(--bpm-line);border-radius:7px}
.hk-bpm-detector .bpm-console .hk-file-activity{grid-column:1/-1;margin:0;padding:12px 22px;border:0;border-top:1px solid var(--bpm-line);border-radius:0;background:#111d23}
.hk-bpm-detector .bpm-console .hk-file-stage{font-size:.95rem;line-height:1.6;margin:0 0 6px}
.hk-bpm-detector .bpm-console .hk-file-note{font-size:.8rem;line-height:1.5;margin:4px 0 0}
.hk-bpm-detector .hk-file-activity[data-state=done] progress{display:none}
.hk-bpm-detector .bpm-console:has(.hk-file-activity:not([hidden])) #session-status{display:none}
.hk-bpm-detector .hk-session-options:empty{display:none}
.hk-bpm-detector details.bpm-quick-help{padding:0 18px;margin:0 0 16px;box-shadow:none}
.hk-bpm-detector .bpm-quick-help>summary{cursor:pointer;padding:14px 0;min-height:44px;box-sizing:border-box;line-height:1.4}
.hk-bpm-detector .bpm-quick-help>summary h2{display:inline;font-size:1rem;margin:0;line-height:1.4}
.hk-bpm-detector .bpm-quick-help[open]{padding-bottom:12px}
.hk-bpm-detector .hk-tool-instructions>ol{padding-left:1.3em}
.hk-bpm-detector .hk-tool-instructions>ol>li{margin:10px 0}
.hk-bpm-detector .hk-tool-resources{margin-top:0}
.hk-bpm-detector :is(button,summary,input,a):focus-visible{outline:2px solid #7de3dd;outline-offset:3px}
.bpm-reference-table{width:100%;border-collapse:collapse;margin:16px 0}
.bpm-reference-table th,.bpm-reference-table td{padding:10px;text-align:left;border-bottom:1px solid var(--border);font-variant-numeric:tabular-nums}
.bpm-worked-example{padding:16px;border-left:3px solid #57c4c0;background:#17282d;margin:20px 0}
.bpm-worked-example p:last-child{margin-bottom:0}
@media(max-width:760px){.hk-bpm-detector .tool-panel.bpm-console{grid-template-columns:minmax(0,1fr)}.bpm-console-result{border-left:0;border-top:1px solid var(--bpm-line)}.bpm-console-source,.bpm-console-result{padding:18px}.hk-bpm-detector .bpm-console .hk-file-activity{padding:12px 18px}.hk-bpm-detector .tool-header{margin-bottom:14px}.hk-bpm-detector .bpm-example{gap:4px 10px}}
@media(max-width:380px){.bpm-console-source,.bpm-console-result{padding:14px}.hk-bpm-detector .bpm-console #session-result{font-size:2.2rem}.bpm-reference-table th,.bpm-reference-table td{padding:8px;font-size:.9rem}}

/* Keep the main transport and sample loader in one action row. */
.hk-bpm-detector .bpm-console-source{padding:18px}
.hk-bpm-detector .bpm-console-actions .bpm-example{display:contents}
.hk-bpm-detector .bpm-console-actions .bpm-example>span{flex-basis:100%;margin:0}
.hk-bpm-detector .bpm-console .hk-source-preview{margin:10px 0 14px}
.hk-bpm-detector .bpm-console-result{padding:18px}
/* Match the tool shell specificity and keep pointer controls compact on desktop. */
body.hk-tool.hk-bpm-detector main{padding-top:12px}
body.hk-bpm-detector .tool-header{padding-bottom:12px;margin-bottom:12px}
body.hk-bpm-detector .tool-header h1{font-size:clamp(1.75rem,3vw,2.15rem);margin-bottom:8px}
body.hk-bpm-detector .studio-toolbar{margin-bottom:12px;padding-bottom:8px}
@media(min-width:980px) and (pointer:fine){.hk-bpm-detector .hk-audio-seek{min-height:24px;height:24px;padding:0;margin-top:6px}.hk-bpm-detector .hk-audio-player{padding:8px}.hk-bpm-detector .bpm-console-source,.hk-bpm-detector .bpm-console-result{padding:16px}.hk-bpm-detector .bpm-console .hk-file-activity{padding:10px 16px}}
@media(min-width:980px) and (pointer:fine){body.hk-tool.hk-bpm-detector .hk-audio-seek{min-height:24px;height:24px;padding:0;margin-top:6px}body.hk-tool.hk-bpm-detector .bpm-console .hk-file-activity{padding-top:8px;padding-bottom:8px}}

.hk-bpm-detector .bpm-console-actions .bpm-example>span{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}

.bpm-console-source>h2,.bpm-console-result>h2{font-family:var(--font-body);font-size:1rem;line-height:1.4;margin:0 0 16px;color:#e8f2f3}.bpm-console-source #session-run{background:#61c9c4;color:#0c2025;border-color:#61c9c4;font-weight:600}
