:root {
    font:
        13px/1.35 Verdana,
        Tahoma,
        sans-serif;
    --face: #ece9d8;
    --ink: #24232a;
    --subtle: #545453;
    --edge: #77766b;
    --light: #fffef6;
    --panel: #e4e0d1;
    --header: #cfcaba;
    --input: #faf9f3;
    --selection: #c7dcf6;
    --accent: #154891;
    --title1: #18418b;
    --title2: #397fd2;
    --hit: #83b2d7;
    --accent-step: #ecc178;
    --cell: #e9e6db;
    --alternate: #d9d5c7;
    --play: #add9ba;
    --wave-bg: #0e2327;
    --wave-grid: #304c44;
    --wave-fill: #1f453c;
    --wave: #a5e5ae;
    --trim: #ffcf6f;
    --active: #3d7531;
    --back: #bbc0b7;
    --art-bg: #e0dfd6;
    --error: #8a220e;
}
:root[data-theme='dark'],
:root[data-theme='zune'] {
    color-scheme: dark;
    --face: #272a30;
    --ink: #f3f4f7;
    --subtle: #bfc4cd;
    --edge: #131519;
    --light: #52565e;
    --panel: #2f3238;
    --header: #3a3f47;
    --input: #202329;
    --selection: #38536d;
    --accent: #9ac7f1;
    --title1: #363c45;
    --title2: #20242c;
    --hit: #5f94c1;
    --accent-step: #dda862;
    --cell: #393d44;
    --alternate: #30343c;
    --play: #394e5e;
    --wave-bg: #151b22;
    --wave-grid: #384c5a;
    --wave-fill: #243947;
    --wave: #9dd5ec;
    --active: #a3d58e;
    --back: #191b20;
    --art-bg: #454951;
    --error: #ffa899;
}
:root[data-theme='zune'] {
    --face: #292828;
    --ink: #fff6ec;
    --subtle: #d4c4b4;
    --light: #605958;
    --panel: #333130;
    --header: #413d3a;
    --input: #211f1e;
    --selection: #613a26;
    --accent: #ffad62;
    --title1: #50453d;
    --title2: #262322;
    --hit: #b76e43;
    --accent-step: #fb9b54;
    --cell: #423d39;
    --alternate: #37322f;
    --play: #68482f;
    --wave-bg: #221a15;
    --wave-grid: #544030;
    --wave-fill: #3c291e;
    --wave: #ffba76;
    --back: #191715;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    color: var(--ink);
    background: var(--back);
}
#instrument {
    min-height: 100vh;
    max-width: 1680px;
    min-width: 900px;
    margin: auto;
    background: var(--face);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 0 1px var(--edge);
}
button,
input,
select {
    font: inherit;
    color: inherit;
}
button,
select {
    background: var(--face);
    border: 1px solid;
    border-color: var(--light) var(--edge) var(--edge) var(--light);
    padding: 4px 9px;
    min-height: 25px;
    border-radius: 2px;
}
button:not(:disabled),
select:not(:disabled),
input[type='checkbox'],
input[type='range'] {
    cursor: pointer;
}
button:hover:not(:disabled) {
    background: color-mix(in srgb, var(--face), var(--light) 28%);
}
button:active:not(:disabled),
button[aria-pressed='true'],
button[aria-selected='true'] {
    border-color: var(--edge) var(--light) var(--light) var(--edge);
    background: var(--selection);
}
button:disabled,
input:disabled {
    opacity: 0.48;
    cursor: default;
}
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
input:not([type='range'], [type='checkbox']),
select {
    background-color: var(--input);
}
input:not([type='range'], [type='checkbox']) {
    border: 1px solid var(--edge);
    padding: 3px 5px;
    min-height: 25px;
    border-radius: 1px;
}
input[type='checkbox'] {
    accent-color: var(--accent);
    vertical-align: -2px;
}
input[type='range'] {
    accent-color: var(--accent);
    min-width: 35px;
    width: 100%;
    margin: 0;
    height: 18px;
}
input[type='number'] {
    font-variant-numeric: tabular-nums;
    text-align: right;
}
label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
h1,
h2,
h3,
p {
    margin: 0;
}
h2 {
    font-size: 13px;
    font-weight: 700;
}
h3 {
    font-size: 12px;
    margin: 2px 0 8px;
}
.titlebar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 7px 11px;
    background: linear-gradient(var(--title1), var(--title2));
    border-bottom: 1px solid var(--edge);
    color: white;
}
.titlebar h1 {
    display: flex;
    gap: 9px;
    align-items: center;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1.1px;
    white-space: nowrap;
}
.drawer-icon {
    width: 22px;
    height: 16px;
    border: 1px solid #6b501c;
    border-top: 3px solid #eed6a5;
    border-radius: 2px;
    background: linear-gradient(#ceaa73, #ad7f3f);
    position: relative;
    box-shadow: 0 1px 2px #0007;
}
.drawer-icon:after {
    content: '';
    position: absolute;
    inset: 4px 5px auto;
    height: 2px;
    border-bottom: 1px solid #f9e6bc;
    background: #79582d;
}
.title-actions {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 5px;
    justify-content: end;
}
.title-actions label {
    margin-right: auto;
    margin-left: clamp(0px, 5vw, 90px);
    font-size: 12px;
}
.title-actions button,
.title-actions select {
    color: var(--ink);
}
.toolbar {
    display: flex;
    gap: 6px;
    align-items: center;
}
.commandbar {
    padding: 7px 10px;
    border-bottom: 1px solid var(--edge);
    box-shadow: 0 1px 0 var(--light);
}
.spacer {
    flex: 1;
}
.separator {
    align-self: stretch;
    border-left: 1px solid var(--edge);
    border-right: 1px solid var(--light);
    margin: 2px;
}
.workspace {
    display: grid;
    grid-template-columns: clamp(145px, 14vw, 208px) minmax(330px, 1fr) minmax(340px, 1fr);
    grid-template-rows: auto 1fr;
    gap: 8px;
    padding: 9px;
    flex: 1;
}
.panel,
dialog {
    background: var(--panel);
    border: 1px solid;
    border-color: var(--light) var(--edge) var(--edge) var(--light);
}
.panel {
    min-width: 0;
}
.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 27px;
    padding: 3px 9px;
    background: var(--header);
    border-bottom: 1px solid var(--edge);
}
.panel-title span,
.wave-meta span {
    font-size: 11px;
    color: var(--subtle);
    font-variant-numeric: tabular-nums;
}
.pads {
    grid-row: 1/3;
    display: flex;
    flex-direction: column;
}
#pad-list {
    display: grid;
    grid-template-rows: repeat(10, minmax(43px, 1fr));
    flex: 1;
}
.pad-row {
    display: grid;
    grid-template-columns: 1fr 23px;
    min-height: 0;
    padding: 3px;
    gap: 2px;
    border-bottom: 1px solid var(--edge);
}
.pad-row:last-child {
    border: 0;
}
.pad-row.selected {
    background: var(--selection);
    box-shadow: inset 3px 0 var(--accent);
}
.pad-play {
    display: grid;
    grid-template-columns: clamp(34px, 3.8vw, 62px) minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    text-align: left;
    padding: 2px;
    border: none;
    background: transparent;
    min-height: 0;
}
.pad-play:hover:not(:disabled) {
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--accent);
}
.pad-play:active {
    transform: translateY(1px);
}
.photo {
    display: block;
    background-color: var(--art-bg);
    background-repeat: no-repeat;
    aspect-ratio: 1;
    border: 1px solid var(--edge);
}
.pad-play .photo {
    width: 100%;
    max-height: 57px;
    object-fit: contain;
}
.pad-label {
    display: grid;
    gap: 1px;
    min-width: 0;
}
.pad-label strong,
.pad-label small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.pad-label strong {
    font-size: 12px;
}
.pad-label small {
    font-size: 10px;
    color: var(--subtle);
}
.pad-label output {
    font: 10px/1.3 monospace;
    color: var(--subtle);
}
.arrows {
    display: flex;
    flex-direction: column;
    align-self: center;
    gap: 1px;
}
.arrows button {
    font-size: 7px;
    min-height: 14px;
    padding: 1px 2px;
    line-height: 1.4;
}
.sequencer {
    grid-column: 2/4;
    padding-bottom: 5px;
}
.beat-tools {
    padding: 7px 7px 4px;
    flex-wrap: wrap;
}
.beat-tools label,
.lane-tools {
    font-size: 11px;
}
.beat-tools input {
    width: 53px;
}
#transport {
    min-width: 69px;
}
#slots {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 3px;
    margin: 3px 7px;
}
.slot {
    min-width: 0;
    display: flex;
}
.slot button {
    padding: 3px;
    font-size: 10px;
    min-height: 22px;
}
.slot button:first-child {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.slot .launch {
    width: 20px;
    flex: none;
}
.launch.playing {
    color: var(--active);
    font-weight: bold;
}
.lane-tools {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 5px 7px 2px;
}
.lane-tools button {
    padding: 2px 7px;
    min-height: 21px;
    font-size: 11px;
}
#slot-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.segmented {
    display: flex;
    gap: 2px;
}
.grid-container {
    margin: 0 6px;
}
#steps {
    display: block;
    width: 100%;
    height: clamp(170px, 24vh, 250px);
    touch-action: none;
}
.section-content {
    padding: 8px 10px;
}
.wave-tabs button,
.detail-tabs button {
    min-width: 65px;
    flex: 1;
    font-size: 12px;
}
.wave-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
    padding: 8px 0 3px;
    font-size: 11px;
}
.wave-meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wave-file {
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--subtle);
    font-size: 11px;
}
#wave {
    display: block;
    width: 100%;
    height: clamp(77px, 12vh, 145px);
    background: var(--wave-bg);
    border: 1px solid var(--edge);
    touch-action: none;
}
.wave-actions {
    min-height: 33px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    font-size: 11px;
}
.wave-actions button {
    font-size: 11px;
    padding: 2px 5px;
    min-height: 21px;
}
.wave-actions input[type='number'] {
    width: 76px;
}
.section-divider {
    border-top: 1px solid var(--edge);
    border-bottom: 1px solid var(--light);
    margin: 8px 0;
}
.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px 14px;
}
.control {
    font-size: 11px;
    display: grid;
    grid-template-columns: minmax(65px, auto) minmax(36px, 1fr) minmax(43px, 57px) auto;
    align-items: center;
    gap: 5px;
    min-width: 0;
    padding: 3px 0;
}
.control span:first-child {
    white-space: nowrap;
}
.control input[type='number'] {
    width: 100%;
    font-size: 11px;
    min-height: 21px;
    padding: 2px;
    appearance: textfield;
    -moz-appearance: textfield;
}
.control input::-webkit-inner-spin-button {
    appearance: none;
}
.control .unit {
    color: var(--subtle);
    font-size: 10px;
    min-width: 0;
}
#kit-level {
    width: clamp(150px, 18vw, 250px);
}
#kit-level .control {
    grid-template-columns: auto 1fr 40px auto;
}
.field-grid .control {
    grid-template-columns: minmax(30px, 1fr) 51px auto;
}
.field-grid .control span:first-child {
    grid-column: 1/-1;
}
#sound-controls {
    margin: 8px 0;
}
#pad-mix {
    margin-bottom: 11px;
}
.fx-select,
.wrap-actions,
.mix-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 12px;
}
.fx-select {
    margin-bottom: 5px;
}
.fx-select select {
    min-width: 125px;
}
.wrap-actions {
    margin-top: 8px;
}
.mix-options {
    justify-content: space-between;
    margin: 6px 0 10px;
}
.fx-note,
.control-note {
    color: var(--subtle);
    font-size: 11px;
    margin: 5px 0;
}
footer {
    display: flex;
    gap: 10px;
    padding: 5px 9px;
    align-items: center;
    font-size: 11px;
    border-top: 1px solid var(--edge);
    color: var(--subtle);
    min-height: 29px;
}
footer output {
    border-left: 1px solid var(--edge);
    padding-left: 10px;
    color: var(--ink);
}
footer output:empty {
    border: 0;
}
footer output.error,
.error {
    color: var(--error);
}
dialog {
    color: var(--ink);
    padding: 0;
    min-width: 300px;
    max-width: min(780px, 94vw);
    max-height: 90vh;
    box-shadow: 3px 6px 23px #0005;
}
dialog::backdrop {
    background: rgb(8 15 20 / 0.34);
}
.dialog-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(var(--title1), var(--title2));
    color: white;
    padding: 5px 8px;
    position: sticky;
    top: 0;
    z-index: 1;
}
.dialog-title button {
    min-height: 19px;
    padding: 0 5px;
    font: 16px/1 Verdana;
    color: var(--ink);
}
.dialog-body {
    padding: 12px;
    display: grid;
    gap: 10px;
}
.dialog-body fieldset {
    margin: 0;
    padding: 7px 9px;
    border: 1px solid var(--edge);
    min-width: 0;
}
.dialog-body legend {
    font-weight: bold;
}
.dialog-body h3 {
    margin: 0;
}
.button-row,
.filters,
.dialog-footer {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.dialog-footer {
    justify-content: flex-end;
}
.dialog-body input[type='text'],
.dialog-body input[type='search'] {
    max-width: 100%;
    min-width: 90px;
}
.stack {
    display: grid;
    gap: 7px;
}
.library-list {
    min-width: 230px;
    overflow-y: auto;
    max-height: 37vh;
    border: 1px solid var(--edge);
    background: var(--input);
}
.library-row {
    display: grid;
    grid-template-columns: minmax(150px, 2fr) minmax(80px, 1fr) minmax(80px, 1fr) 44px;
    min-width: 100%;
    padding: 5px 8px;
    gap: 8px;
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--panel);
    background: transparent;
    border-radius: 0;
    font-size: 12px;
}
.library-row[aria-selected='true'] {
    background: var(--selection);
}
.library-row small {
    align-self: center;
    color: var(--subtle);
}
.filters input {
    flex: 1;
}
.dialog-info {
    margin: 0;
    color: var(--subtle);
    font-size: 12px;
}
.photo-choices {
    display: grid;
    grid-template-columns: repeat(4, minmax(78px, 1fr));
    gap: 5px;
}
.photo-choices button {
    display: grid;
    place-items: center;
    gap: 2px;
    font-size: 10px;
    min-width: 0;
    padding: 4px;
}
.photo-choices .photo {
    width: clamp(45px, 6vh, 76px);
}
.appearance-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.appearance-head .photo {
    width: 80px;
    flex: none;
}
.appearance-head input {
    width: 100%;
}
.export-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(90px, 1fr));
    gap: 5px;
}
.export-grid button {
    min-width: 110px;
}
.error:empty {
    display: none;
}
@media (max-width: 1130px) {
    :root {
        font-size: 12px;
    }
    .workspace {
        gap: 5px;
        padding: 5px;
        grid-template-columns: 145px minmax(330px, 1fr) minmax(330px, 1fr);
    }
    .title-actions label {
        margin-left: 0;
    }
    .toolbar {
        gap: 4px;
    }
    .commandbar button {
        padding: 3px 6px;
    }
    .field-grid {
        column-gap: 8px;
    }
}
.chain-entries {
    margin: 0;
    padding-left: 26px;
    max-height: 48vh;
    overflow: auto;
}
.chain-entries li {
    padding: 2px;
    font-size: 12px;
}
.chain-entries button {
    margin-left: 10px;
    min-height: 19px;
    font-size: 10px;
    padding: 2px 4px;
}
.library-list > p {
    margin: 10px;
}
