/* The SoundFont converters (SF2 to WAV, WAV to SF2, SF2 to SFZ, SFZ to SF2). They
   use the MIDI to WAV converter's steps, drop zones and buttons
   (/tools/midi-to-wav/midi-to-wav.css); this adds what they need on top. */

/* ── Two-way choice, as the General MIDI strip ── */
.kit-choice {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.kit-choice .m2w-gm[aria-pressed="false"] { opacity: 0.85; }

/* ── Settings ── */
.kit-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 16px;
    align-items: end;
}

.kit-fields .m2w-field select,
.kit-fields .m2w-field input,
.kit-input {
    min-width: 0;
    font: 700 1rem/1.2 var(--font-body);
    color: var(--ink);
    background: var(--cream);
    border: var(--line) solid var(--ink);
    border-radius: 10px;
    padding: 10px 12px 9px;
    box-shadow: 0 4px 0 var(--ink);
}

.kit-fields .m2w-field select { min-width: 140px; }
.kit-fields .m2w-field input[type="number"] { width: 6.5em; }
.kit-fields .kit-wide { flex: 1 1 260px; }
.kit-fields .kit-wide select,
.kit-fields .kit-wide input { width: 100%; }
.kit-fields .m2w-check { flex-basis: auto; }

.kit-hint { font-size: 0.93rem; color: var(--muted); }

/* ── Lists: presets to pick, samples to map ── */
.kit-list {
    max-height: 360px;
    overflow: auto;
    border: var(--line) solid var(--ink);
    border-radius: 10px;
    background: var(--panel-raised);
}

.kit-list-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
}

.kit-list-head p { font-weight: 700; }

.kit-link-button {
    padding: 0;
    font: 700 0.95rem/1.2 var(--font-body);
    color: var(--link);
    background: none;
    border: 0;
    cursor: pointer;
}

.kit-link-button + .kit-link-button { margin-left: 14px; }

.kit-preset {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--dim);
    cursor: pointer;
}

.kit-preset:last-child { border-bottom: 0; }
.kit-preset input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.kit-preset-num { flex: none; min-width: 4.6em; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; }

.kit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.kit-table th,
.kit-table td {
    padding: 8px 10px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--dim);
}

.kit-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    font-size: 0.85rem;
    background: var(--panel-raised);
}

.kit-table tr:last-child td { border-bottom: 0; }
.kit-table td:first-child { overflow-wrap: anywhere; font-weight: 600; }
.kit-table select { font: 600 0.95rem/1.2 var(--font-body); padding: 5px 6px; border: 2px solid var(--ink); border-radius: 8px; background: var(--cream); color: var(--ink); }
.kit-table .kit-from { display: block; font-size: 0.8rem; font-weight: 500; color: var(--muted); }

.kit-remove {
    width: 30px;
    height: 30px;
    font: 700 1.1rem/1 var(--font-body);
    color: var(--ink);
    background: var(--cream);
    border: 2px solid var(--ink);
    border-radius: 8px;
    cursor: pointer;
}

/* ── After converting: what came across and what didn't ── */
.kit-report { display: grid; gap: 6px; font-size: 0.95rem; }
.kit-report ul { margin: 0; padding-left: 1.2em; }
.kit-report li { margin: 2px 0; }

.kit-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}

/* ── The other converters ── */
.kit-others {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 12px;
}

.kit-others a { color: var(--link); font-weight: 700; }
.kit-others a[aria-current="page"] { color: var(--muted); pointer-events: none; }

main > section.kit-about { max-width: 860px; padding-top: 8px; }

/* Long preset names mustn't widen the steps past the screen. */
main.kit-page > section.m2w-app,
.kit-page .m2w-step { grid-template-columns: minmax(0, 1fr); }
.kit-page .m2w-step > * { min-width: 0; }
.kit-fields .m2w-field select,
.kit-fields .m2w-field input { max-width: 100%; }
.kit-about .section-text + .section-text { margin-top: 12px; }
.kit-about a { color: var(--link); font-weight: 700; }

@media (max-width: 640px) {
    .kit-fields > * { flex: 1 1 calc(50% - 8px); }
    .kit-fields > .kit-wide,
    .kit-fields > .m2w-check { flex-basis: 100%; }
    .kit-fields .m2w-field select,
    .kit-fields .m2w-field input { width: 100%; }
    .kit-table th, .kit-table td { padding: 8px 6px; }
    .kit-actions > .button { width: 100%; justify-content: center; }
}

/* Download buttons carry the file name, which can be long. */
.kit-page .m2w-download { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.kit-page .m2w-result-row > * { min-width: 0; }

/* On phones each sample is a small card: its name, then root note, loop and remove. */
@media (max-width: 640px) {
    .kit-table thead { display: none; }
    .kit-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        gap: 8px;
        align-items: start;
        padding: 10px 12px;
        border-bottom: 1px solid var(--dim);
    }
    .kit-table tr:last-child { border-bottom: 0; }
    .kit-table td { padding: 0; border: 0; }
    .kit-table td:first-child { grid-column: 1 / -1; }
    .kit-table select { width: 100%; }
}
