/* ==========================================================================
   Free Music Tools: tabs, tools overview, vocal remover / stems mixer,
   BPM & key cards, chord grid with piano diagrams. On top of home.css and
   free-mastering.css. Flat colours, soft corners, nothing moves under the mouse.
   ========================================================================== */

/* Tabs between the tools */
.tt-tabs { display: flex; gap: 6px; margin: 0 auto 12px; padding: 6px; width: max-content; max-width: 100%; overflow-x: auto; border-radius: 999px; background: var(--h-card); scrollbar-width: none; }
.tt-tabs::-webkit-scrollbar { display: none; }
.tt-tabs a { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px; color: var(--h-muted); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.tt-tabs a[aria-current="page"] { background: var(--h-text); color: var(--h-page); }
html[data-theme="dark"] .tt-tabs { box-shadow: inset 0 0 0 1px var(--h-line); }

/* Tool card */
.at-tool { display: grid; gap: 10px; padding: 10px; border-radius: var(--fm-r-big); background: var(--h-card); }
html[data-theme="dark"] .at-tool { box-shadow: inset 0 0 0 1px var(--h-line); }
.at-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: stretch; gap: 10px; }
.at-drop { display: flex; justify-items: initial; justify-content: flex-start; align-items: center; gap: 18px; padding: 22px 24px; text-align: left; }
.at-drop .fm-drop-icon { flex: none; margin: 0; }
.at-drop-text { display: grid; gap: 4px; }
.at-drop-text span { font-size: 14px; }
.at-file { align-self: stretch; }
.at-side { display: grid; align-content: center; gap: 10px; padding: 14px; border-radius: var(--fm-r); background: var(--h-page); }
.at-go { height: 56px; }
.at-note { color: var(--h-muted); font-size: 12.5px; line-height: 1.5; }
.at-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.at-choice label { position: relative; cursor: pointer; }
.at-choice input { position: absolute; opacity: 0; pointer-events: none; }
.at-choice span { display: grid; gap: 2px; padding: 10px 14px; border-radius: calc(var(--fm-r) * .8); background: var(--h-card); }
.at-choice strong { font-size: 14px; }
.at-choice small { color: var(--h-muted); font-size: 12px; }
.at-choice input:checked + span { background: var(--h-text); color: var(--h-page); }
.at-choice input:checked + span small { color: color-mix(in srgb, var(--h-page) 70%, var(--h-text)); }
.at-choice input:focus-visible + span { outline: 2px solid var(--h-accent); outline-offset: 2px; }

.at-panel { padding: clamp(18px, 2.4vw, 30px); border-radius: var(--fm-r); background: var(--h-page); }
.at-pane[hidden] { display: none; }
.at-empty { display: grid; justify-items: center; gap: 8px; padding: clamp(24px, 4vw, 48px) 8px; text-align: center; }
.at-empty strong { font-family: var(--h-font-head); font-size: clamp(20px, 1.8vw, 26px); font-weight: 800; letter-spacing: -.03em; }
.at-empty .fm-privacy { justify-content: center; margin: 0; font-size: 12.5px; }
.at-work { max-width: 640px; }
.at-tool.is-indeterminate .fm-bar i { width: 30% !important; animation: fm-slide 1.4s ease-in-out infinite; }
.at-tool[data-state="uploading"] .at-top, .at-tool[data-state="processing"] .at-top { opacity: .5; pointer-events: none; }

/* Shared: result header, pills, waveform, play */
.at-mix-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.at-pill, .at-zip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--h-card); color: var(--h-text); font: inherit; font-size: 13.5px; font-weight: 700; text-decoration: none; cursor: pointer; }
.at-zip { background: var(--h-text); color: var(--h-page); }
.at-zip svg, .at-dl svg { width: 18px; height: 18px; }
.at-pill.is-on { background: var(--h-text); color: var(--h-page); }
.at-led { width: 8px; height: 8px; border-radius: 50%; background: var(--h-muted); }
.at-pill.is-on .at-led { background: #12a150; }
.at-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; padding: 4px; border-radius: 999px; background: var(--h-card); }
.at-seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--h-text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.at-seg button.is-on { background: var(--h-text); color: var(--h-page); }

.at-mix-head { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px; border-radius: var(--fm-r); background: var(--h-card); }
.at-play svg { width: 22px; height: 22px; }
.at-play .i-pause, .is-playing .at-play svg:first-child { display: none; }
.is-playing .at-play .i-pause { display: block; }
.at-wave { position: relative; height: 56px; cursor: pointer; touch-action: none; }
.at-wave-bars { position: absolute; inset: 0; display: flex; align-items: center; gap: 1px; }
.at-wave-bars i { flex: 1; min-height: 2px; border-radius: 2px; background: color-mix(in srgb, var(--h-text) 22%, transparent); }
.at-wave-done { position: absolute; inset: 0 auto 0 0; width: 0; overflow: hidden; }
.at-wave-done .at-wave-bars i { background: var(--h-accent); }

/* Mixer rows */
.at-rows { display: grid; gap: 6px; margin-top: 10px; }
.at-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 10px 12px 10px 16px; border-radius: calc(var(--fm-r) * .8); background: var(--h-card); }
.at-row.is-off .at-row-wave, .at-row.is-off .at-row-name { opacity: .35; }
.at-row-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.at-row-name strong { font-size: 14.5px; }
.at-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--h-text); }
.at-row[data-stem="vocals"] .at-dot { background: #ff3b6b; }
.at-row[data-stem="instrumental"] .at-dot { background: #3b6cff; }
.at-row[data-stem="drums"] .at-dot { background: #ff9f1c; }
.at-row[data-stem="bass"] .at-dot { background: #12a150; }
.at-row[data-stem="guitar"] .at-dot { background: #a259ff; }
.at-row[data-stem="piano"] .at-dot { background: #00b3c7; }
.at-row[data-stem="other"] .at-dot { background: #8b8b93; }
.at-row-wave { position: relative; height: 34px; }
.at-row-tog, .at-row-dl { display: flex; gap: 6px; }
.at-tog { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--h-page); color: var(--h-text); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.at-tog.is-on { background: var(--h-text); color: var(--h-page); }
.at-dl { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--h-page); color: var(--h-text); font-size: 12.5px; font-weight: 700; text-decoration: none; }

/* BPM & key */
.at-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.at-cards.is-compact { margin-top: 10px; }
.at-card { display: grid; align-content: start; gap: 6px; padding: clamp(18px, 2vw, 26px); border-radius: var(--fm-r); background: var(--h-card); }
.at-card-k { color: var(--h-muted); font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.at-card-v { font-family: var(--h-font-head); font-size: clamp(48px, 5.4vw, 84px); font-weight: 800; line-height: .95; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.at-cards.is-compact .at-card-v { font-size: clamp(30px, 3vw, 44px); }
.at-card-v small { margin-left: 8px; font-size: .32em; letter-spacing: 0; color: var(--h-muted); }
.at-card-sub { color: var(--h-muted); font-size: 13.5px; }
.at-conf { height: 6px; margin-top: 4px; border-radius: 999px; background: color-mix(in srgb, var(--h-text) 10%, transparent); overflow: hidden; }
.at-conf i { display: block; height: 100%; border-radius: inherit; background: var(--h-accent); }
.at-card-camelot .at-card-v { color: var(--h-accent); }
.at-player { display: grid; gap: 10px; }
.at-player-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.at-transpose { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 14px; border-radius: 999px; background: var(--h-card); font-size: 13.5px; font-weight: 600; }
.at-shift { min-width: 28px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Chords */
.at-now { display: grid; grid-template-columns: minmax(200px, .8fr) minmax(0, 1.4fr); align-items: center; gap: clamp(18px, 3vw, 48px); margin-top: 10px; padding: clamp(20px, 2.6vw, 32px); border-radius: 24px; background: var(--h-card); }
.at-now-left { display: grid; gap: 4px; align-content: center; min-width: 0; }
.at-now-name { display: block; min-width: 3ch; margin-top: 4px; font-family: var(--h-font-head); font-size: clamp(56px, 7vw, 104px); font-weight: 600; line-height: .92; letter-spacing: -.05em; }
.at-now-piano { width: 100%; max-width: 620px; justify-self: end; }
.at-chord-info { display: grid; gap: 10px; }
.at-quality { color: var(--h-muted); font-size: 14px; font-weight: 500; text-transform: capitalize; }
.at-chord-info.is-big .at-quality { margin-top: 6px; font-size: 16px; color: var(--h-text); }
.at-notes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.at-notes li { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--h-page); font-size: 12px; }
.at-notes li strong { font-size: 13.5px; font-weight: 600; }
.at-notes li span { color: var(--h-muted); }
.at-notes li.is-root { background: var(--h-accent); color: #fff; }
.at-notes li.is-root span { color: rgba(255, 255, 255, .8); }
.at-chord-info.is-big .at-notes li { padding: 7px 12px; font-size: 13px; }
.at-chord-info.is-big .at-notes li strong { font-size: 15px; }
.at-grid { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 4px; max-height: 300px; margin-top: 10px; padding: 10px; overflow-y: auto; border-radius: 20px; background: var(--h-card); scroll-behavior: smooth; }
.at-beat { min-width: 0; height: 46px; padding: 0 6px; overflow: hidden; border: 0; border-radius: 10px; background: var(--h-page); color: var(--h-text); font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.at-beat.is-bar { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--h-text) 25%, transparent); }
.at-beat.is-now { background: var(--h-accent); color: #fff; box-shadow: none; }
.at-used-wrap { margin-top: 22px; }
.at-used { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.at-chord { display: grid; gap: 12px; padding: 16px; border: 0; border-radius: 20px; background: var(--h-card); color: var(--h-text); font: inherit; text-align: left; cursor: pointer; }
.at-chord-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.at-chord-top strong { font-family: var(--h-font-head); font-size: 26px; font-weight: 600; letter-spacing: -.035em; }
.at-chord-count { color: var(--h-muted); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Piano diagram: two octaves, lit keys labelled with the note (and the interval on the big one) */
.at-piano { display: block; width: 100%; height: auto; overflow: visible; }
.at-piano .k-w { fill: #ffffff; stroke: color-mix(in srgb, var(--h-text) 16%, transparent); stroke-width: 1; }
.at-piano .k-b { fill: #141416; }
.at-piano .k-w.is-tone { fill: color-mix(in srgb, var(--h-accent) 16%, #ffffff); stroke: color-mix(in srgb, var(--h-accent) 45%, transparent); }
.at-piano .k-w.is-root { fill: color-mix(in srgb, var(--h-accent) 26%, #ffffff); stroke: var(--h-accent); }
.at-piano .k-b.is-tone { fill: color-mix(in srgb, var(--h-accent) 55%, #141416); }
.at-piano .k-b.is-root { fill: var(--h-accent); }
.at-piano .k-dot { fill: #141416; }
.at-piano .k-dot.is-root { fill: var(--h-accent); }
.at-piano .k-dot.is-black { fill: #ffffff; }
.at-piano .k-dot.is-black.is-root { fill: #ffffff; }
.at-piano .k-lab { fill: #ffffff; font-family: var(--h-font-body); font-size: 9.5px; font-weight: 700; text-anchor: middle; }
.at-piano .k-lab.is-small { fill: #141416; font-size: 8px; }
.at-piano .k-lab.is-small.is-root { fill: var(--h-accent); }
.at-piano.is-big .k-lab { font-size: 11px; }
.at-piano.is-big .k-lab.is-small { font-size: 9.5px; }
.at-piano .k-iv { fill: color-mix(in srgb, var(--h-accent) 80%, #141416); font-family: var(--h-font-body); font-size: 10px; font-weight: 700; text-anchor: middle; }
.at-piano .k-iv.is-black { fill: #ffffff; }
.at-piano .k-c { fill: #9a9aa2; font-family: var(--h-font-body); font-size: 8px; font-weight: 600; text-anchor: middle; }
html[data-theme="dark"] .at-piano .k-w { fill: #ececef; stroke: #2a2a2e; }
html[data-theme="dark"] .at-piano .k-w.is-tone { fill: color-mix(in srgb, var(--h-accent) 24%, #ececef); }
html[data-theme="dark"] .at-piano .k-w.is-root { fill: color-mix(in srgb, var(--h-accent) 36%, #ececef); }
html[data-theme="dark"] .at-piano .k-b { fill: #0a0a0b; }
@media (max-width: 760px) {
    .at-now { grid-template-columns: minmax(0, 1fr); }
    .at-now-piano { justify-self: stretch; max-width: none; }
    .at-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

/* Tools overview */
.hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.hub-grid li:first-child { grid-column: span 2; }
.hub-card { position: relative; display: grid; align-content: start; gap: 10px; height: 100%; min-height: 240px; padding: clamp(22px, 2.6vw, 34px); border-radius: var(--fm-r-big); background: var(--h-card); color: var(--h-text); text-decoration: none; }
html[data-theme="dark"] .hub-card { box-shadow: inset 0 0 0 1px var(--h-line); }
.hub-num { position: absolute; top: clamp(22px, 2.6vw, 34px); right: clamp(22px, 2.6vw, 34px); color: var(--h-muted); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hub-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 18px; border-radius: 50%; background: var(--h-text); color: var(--h-page); }
.hub-icon svg { width: 26px; height: 26px; }
.hub-card strong { font-family: var(--h-font-head); font-size: clamp(24px, 2.4vw, 34px); font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.hub-card > span:not(.hub-num):not(.hub-icon) { max-width: 360px; color: var(--h-muted); font-size: 15px; }
.hub-card em { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 18px; font-size: 14px; font-style: normal; font-weight: 700; }
.hub-card em svg { width: 18px; height: 18px; }
.hub-grid li:first-child .hub-card { background: var(--h-text); color: var(--h-page); }
.hub-grid li:first-child .hub-card > span:not(.hub-num):not(.hub-icon), .hub-grid li:first-child .hub-num { color: color-mix(in srgb, var(--h-page) 70%, var(--h-text)); }
.hub-grid li:first-child .hub-icon { background: var(--h-page); color: var(--h-text); }

@media (max-width: 1080px) {
    .at-top { grid-template-columns: minmax(0, 1fr); }
    .at-row { grid-template-columns: 120px minmax(0, 1fr) auto; }
    .at-row-dl { grid-column: 1 / -1; }
    .at-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
    .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .tt-tabs { width: 100%; }
    .at-cards { grid-template-columns: minmax(0, 1fr); }
    .at-row { grid-template-columns: minmax(0, 1fr) auto; }
    .at-row-wave { grid-column: 1 / -1; grid-row: 2; }
    .at-row-dl { grid-row: 3; }
    .at-now { grid-template-columns: minmax(0, 1fr); }
    .at-now-piano { justify-self: stretch; }
    .at-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .hub-grid { grid-template-columns: minmax(0, 1fr); }
    .hub-grid li:first-child { grid-column: auto; }
}

/* Minimal type scale (v5.26) */
.tt-tabs a { height: 36px; padding: 0 15px; font-size: 13.5px; }
.at-drop-text strong { font-size: 17px; font-weight: 600; }
.at-card-v { font-size: clamp(34px, 3.4vw, 52px); font-weight: 600; letter-spacing: -.04em; }
.at-cards.is-compact .at-card-v { font-size: clamp(24px, 2.2vw, 32px); }
.at-now-name { font-size: clamp(40px, 4.4vw, 64px); font-weight: 600; letter-spacing: -.04em; }
.at-chord strong { font-size: 18px; font-weight: 600; }
.at-beat { height: 40px; font-size: 13px; font-weight: 600; }
.hub-card { min-height: 200px; }
.hub-card strong { font-size: clamp(19px, 1.7vw, 24px); font-weight: 600; letter-spacing: -.025em; }
.hub-card > span:not(.hub-num):not(.hub-icon) { font-size: 14px; }
.hub-icon { width: 46px; height: 46px; margin-bottom: 10px; }
.hub-icon svg { width: 22px; height: 22px; }

/* Four tools: a 2 × 2 grid */
.hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hub-grid li:first-child { grid-column: auto; }
@media (max-width: 640px) { .hub-grid { grid-template-columns: minmax(0, 1fr); } }
