.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto auto 1fr;
}

.app-bar,
.transport {
    position: sticky;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.app-bar {
    top: 0;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, auto);
}

.transport {
    top: 61px;
    justify-content: flex-end;
}

.app-tools {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.brand {
    display: grid;
    gap: 2px;
    margin-right: auto;
}

.brand-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand-sub {
    color: var(--muted);
    font-size: 11px;
}

.transport-button,
.transport-readout,
.tool-button {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0d;
    color: var(--ink);
}

.transport-button {
    width: 104px;
    min-width: 104px;
    padding: 0 12px;
}

.tool-button {
    padding: 0 10px;
}

.transport-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.transport-button:disabled {
    cursor: default;
    opacity: 0.45;
}

.transport-button:disabled:hover {
    border-color: var(--line);
    color: var(--ink);
}

.tool-button:hover {
    border-color: var(--accent);
}

.tool-button:disabled {
    cursor: default;
    opacity: 0.45;
}

.transport-button.active {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--bg);
    font-weight: 800;
}

.transport-readout,
.transport-step-group {
    display: grid;
    align-content: center;
    min-width: 78px;
    padding: 4px 10px;
}

.transport-step-group {
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0d;
}

.transport-step-options {
    display: flex;
    gap: 4px;
}

.transport-step-button {
    width: 58px;
    min-height: 22px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #121411;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    padding: 0 7px;
}

.transport-step-button:hover,
.transport-step-button.active {
    border-color: var(--accent);
    color: var(--accent);
}

.transport-step-button.active {
    background: var(--accent);
    color: var(--bg);
}

.transport-field {
    min-height: 36px;
    display: grid;
    align-content: center;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0d;
    padding: 4px 8px;
}

.transport-field input {
    width: 72px;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 14px;
    font-weight: 800;
    outline: none;
}

.transport-label {
    color: var(--muted);
    font-size: 9px;
    line-height: 1;
    text-transform: uppercase;
}

.transport-value {
    color: var(--accent);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
}

.workspace {
    min-height: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 12px;
    padding: 14px 16px 18px;
}

.tracker-workbench {
    min-height: 0;
    display: block;
}

.lane-tabs,
.mobile-tracker-panel {
    display: none;
}

.global-conflict {
    border: 1px solid rgba(255, 107, 107, 0.55);
    border-radius: 6px;
    background: rgba(255, 107, 107, 0.1);
    color: #ffd1d1;
    font-size: 12px;
    line-height: 1.35;
    padding: 8px 10px;
}

.global-conflict.empty {
    display: none;
}

.project-message {
    border: 1px solid rgba(74, 155, 139, 0.55);
    border-radius: 6px;
    background: rgba(74, 155, 139, 0.1);
    color: var(--accent-2);
    font-size: 12px;
    line-height: 1.35;
    padding: 8px 10px;
}

.project-message.empty {
    display: none;
}

.tracker-panel {
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.chord-editor {
    position: fixed;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-radius: 0;
    background: var(--panel);
    padding: 12px;
    overflow: auto;
}

.step-editor {
    top: 0;
    right: 0;
    bottom: 0;
    width: min(380px, 92vw);
    border-left: 1px solid var(--line);
    box-shadow: -18px 0 32px rgba(0, 0, 0, 0.35);
}

.settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: min(420px, 92vw);
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-left: 1px solid var(--line);
    background: var(--panel);
    box-shadow: -18px 0 32px rgba(0, 0, 0, 0.35);
    padding: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
}


html.drawer-scroll-locked,
body.drawer-scroll-locked {
    overflow: hidden;
}

.drawer-host.empty {
    display: none;
}

.drawer-scrim {
    position: fixed;
    inset: 0;
    z-index: 30;
    border: 0;
    background: rgba(0, 0, 0, 0.38);
    cursor: default;
}

.confirm-modal .drawer-scrim,
.license-modal .drawer-scrim,
.custom-steps-modal .drawer-scrim,
.transfer-modal .drawer-scrim {
    z-index: 60;
}

.defaults-panel {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    width: min(560px, 92vw);
    max-height: min(720px, 88vh);
    transform: translate(-50%, -50%);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    overflow: auto;
}

.voice-panel {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    width: min(760px, 94vw);
    max-height: min(760px, 88vh);
    transform: translate(-50%, -50%);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    overflow: auto;
}

.voice-sticky-head {
    position: sticky;
    top: -12px;
    z-index: 4;
    display: grid;
    gap: 10px;
    margin: -12px -12px 0;
    padding: 12px 12px 10px;
    border-bottom: 1px solid var(--line-2);
    border-radius: 8px 8px 0 0;
    background: var(--panel);
    box-shadow: 0 10px 18px rgba(7, 10, 18, 0.24);
}

.voice-sticky-head .editor-head {
    padding-bottom: 0;
    border-bottom: 0;
}

.confirm-panel {
    position: fixed;
    z-index: 70;
    top: 50%;
    left: 50%;
    width: min(420px, 92vw);
    display: grid;
    gap: 14px;
    transform: translate(-50%, -50%);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    padding: 12px;
}

.license-panel {
    width: min(640px, 94vw);
    max-height: calc(100dvh - 40px);
    display: flex;
    flex-direction: column;
    border-color: var(--cyan);
    box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.18), 0 24px 80px rgba(0, 0, 0, 0.6);
}

.license-panel .editor-head {
    flex: 0 0 auto;
}

.license-body {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    overflow-y: auto;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.55;
    letter-spacing: 0;
    text-transform: none;
    white-space: pre-wrap;
    scrollbar-width: thin;
    scrollbar-color: var(--cyan) var(--bg-deep);
}

.license-body-link {
    color: var(--cyan);
    text-decoration: underline;
}

.license-body-link:hover {
    color: var(--ink);
}

.license-body::-webkit-scrollbar {
    width: 10px;
}

.license-body::-webkit-scrollbar-track {
    border-radius: 5px;
    background: var(--bg-deep);
}

.license-body::-webkit-scrollbar-thumb {
    border: 2px solid var(--bg-deep);
    border-radius: 5px;
    background: var(--cyan);
}

.license-body::-webkit-scrollbar-thumb:hover {
    background: #5ce6ff;
}

.confirm-message {
    color: var(--ink);
    font-size: 13px;
    line-height: 1.45;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.settings-panel .editor-head {
    flex-shrink: 0;
}

.editor-head {
    display: flex;
    align-items: start;
    gap: 4px;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.editor-head-main {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.editor-head-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.editor-title {
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
}

.editor-context,
.section-label {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.editor-summary {
    color: var(--accent);
    font-size: 14px;
    font-weight: 800;
    min-height: 18px;
}

.degree-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.editor-conflict {
    border: 1px solid rgba(255, 107, 107, 0.55);
    border-radius: 6px;
    background: rgba(255, 107, 107, 0.1);
    color: #ffd1d1;
    font-size: 12px;
    line-height: 1.35;
    padding: 8px 10px;
}

.editor-conflict.empty {
    display: none;
}

.editor-section {
    display: grid;
    gap: 8px;
}

.settings-section {
    display: grid;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
}

/* Settings drawer: drop the dividing line between sections — whitespace-only
   separation, consistent with the other drawers/modals (e.g. step copy). */
.settings-sections .settings-section {
    border-bottom: 0;
}

.brush-row,
.editor-actions,
.editor-clear-actions,
.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mixer-list,
.midi-list {
    display: grid;
    gap: 10px;
}

.mixer-row,
.midi-row {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0d;
    padding: 10px;
}

.mixer-head,
.mixer-controls,
.midi-head,
.midi-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mixer-head,
.midi-head {
    justify-content: space-between;
}

.mixer-name {
    color: var(--ink);
    font-weight: 800;
    text-transform: uppercase;
}

.mixer-value {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.mixer-controls,
.midi-controls {
    align-items: end;
}

.midi-field {
    flex: 1;
}

.settings-note {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0d;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    padding: 8px 10px;
}

.mixer-volume {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 4px;
}

.mixer-voice-button {
    min-height: 34px;
    flex: 1.1;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0d;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    padding: 0 10px;
    text-align: left;
}

.mixer-voice-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.voice-preset-list,
.voice-preset-group {
    display: grid;
    gap: 8px;
}

.voice-category-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.voice-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 8px;
}

.voice-preset-button {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0d;
    color: var(--ink);
    font-weight: 800;
    text-align: left;
    padding: 0 10px;
}

.voice-preset-button:hover,
.voice-preset-button.selected {
    border-color: var(--accent);
    color: var(--accent);
}

.voice-preset-button.selected {
    background: var(--accent);
    color: var(--bg);
}

.voice-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.transfer-modes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.transfer-panel {
    width: min(460px, 94vw);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
}

.transfer-fields {
    gap: 10px;
}

.transfer-panel .editor-select,
.transfer-panel .editor-select:hover,
.transfer-panel .editor-select:focus {
    color: var(--ink);
}

.transfer-panel .editor-select option {
    background: var(--ink);
    color: var(--bg-deep);
}

.transfer-toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.transfer-toggle-row .editor-toggle {
    width: auto;
    padding-inline: 18px;
}

.voice-tab {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0d;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.voice-tab:hover,
.voice-tab.selected {
    border-color: var(--accent);
    color: var(--accent);
}

.voice-tab.selected {
    background: var(--accent);
    color: var(--bg);
}

.voice-tab-panel {
    display: grid;
    gap: 14px;
    min-height: 0;
}

.voice-preset-panel {
    border: 0;
    padding-bottom: 0;
}

.voice-shape-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.voice-control-block,
.voice-slider {
    display: grid;
    gap: 8px;
}

.voice-control-label,
.voice-slider-head {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.voice-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.voice-param-chip {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0d;
    color: var(--ink);
    font-size: 11px;
    font-weight: 900;
    padding: 0 10px;
}

.voice-param-chip:hover,
.voice-param-chip.selected {
    border-color: var(--accent);
    color: var(--accent);
}

.voice-param-chip.selected {
    background: var(--accent);
    color: var(--bg);
}

.voice-param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.voice-slider-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.voice-slider-head b {
    color: var(--ink);
    white-space: nowrap;
}

.voice-slider input[type="range"] {
    width: 100%;
}

.mixer-volume input {
    width: 100%;
    accent-color: var(--accent);
}

.mixer-row.disabled {
    border-color: rgba(127, 140, 161, 0.28);
    opacity: 0.62;
}

.mixer-row.disabled .mixer-name,
.mixer-row.disabled .mixer-value,
.mixer-row.disabled .transport-label {
    color: var(--muted);
}

.mixer-row.disabled::before {
    filter: grayscale(1);
    opacity: 0.55;
}

.mixer-row.disabled .mixer-toggle {
    opacity: 1;
}

.mixer-volume.disabled input {
    cursor: not-allowed;
    opacity: 0.45;
}


.editor-clear-actions {
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.help-list {
    gap: 12px;
}

.help-item {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0d;
    padding: 10px;
}

.help-title {
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.help-body {
    color: var(--ink);
    font-size: 13px;
    line-height: 1.4;
}

.editor-button,
.editor-toggle,
.mixer-toggle,
.degree-button,
.degree-nudge,
.file-button,
.editor-select,
.editor-field input {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0d;
    color: var(--ink);
}

.editor-button,
.editor-toggle,
.mixer-toggle,
.degree-button,
.degree-nudge,
.file-button {
    min-height: 34px;
    padding: 0 10px;
}

.editor-button.icon-close {
    min-width: 0;
    min-height: 0;
    padding: 5px 9px;
    border: 1px solid var(--line-2);
    border-radius: 3px;
    background: var(--bg-deep);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1;
}

.editor-button.icon-close:hover {
    color: var(--bg);
    background: var(--hot);
    border-color: var(--hot);
}

.license-modal .editor-button.icon-close:hover {
    color: var(--bg);
    background: var(--cyan);
    border-color: var(--cyan);
}

.editor-button:hover,
.editor-toggle:hover,
.mixer-toggle:hover,
.degree-button:hover,
.degree-nudge:hover,
.file-button:hover,
.editor-select:hover,
.editor-field input:hover {
    border-color: var(--accent);
}

.editor-button:disabled,
.degree-nudge:disabled {
    cursor: default;
    opacity: 0.45;
}

.editor-button:disabled:hover,
.degree-nudge:disabled:hover {
    border-color: var(--line);
    color: var(--ink);
}

.editor-button.selected,
.editor-toggle.on,
.mixer-toggle.on,
.degree-button.on {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--bg);
    font-weight: 800;
}

.editor-button.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.editor-button.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.file-button {
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    font-size: 13px;
}

.file-button input {
    display: none;
}

.editor-select {
    min-height: 36px;
    width: 100%;
    padding: 0 10px;
}

.degree-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.degree-button {
    min-width: 0;
    padding: 0;
    font-size: 12px;
    font-weight: 700;
}

.nav-button {
    min-width: 34px;
    padding: 0;
}

.selected-degree {
    min-width: 42px;
    display: grid;
    grid-template-rows: 20px minmax(18px, auto) 20px;
    align-items: center;
    justify-items: stretch;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0d;
    padding: 3px;
}

.degree-nudge {
    min-width: 0;
    min-height: 20px;
    padding: 0;
    font-size: 10px;
    font-weight: 800;
}

.selected-degree-label {
    min-width: 0;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
}

.field-grid {
    grid-template-columns: 1fr 1fr;
}

.context-grid {
    grid-template-columns: 1fr 1fr;
}

.editor-field {
    display: grid;
    gap: 5px;
}

.editor-field span {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.editor-field input {
    min-height: 36px;
    width: 100%;
    padding: 0 8px;
}

.editor-field select {
    min-height: 36px;
}

.resolved-notes {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d0e0d;
    color: var(--accent-2);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;
    padding: 9px 10px;
}

.tracker-grid {
    min-width: 760px;
    display: grid;
    grid-template-columns: 76px repeat(4, minmax(150px, 1fr));
}

.mobile-grid {
    min-width: 0;
    grid-template-columns: 76px minmax(160px, 1fr);
}

.corner-cell,
.step-head,
.lane-head,
.step-label,
.step-cell {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.corner-cell,
.lane-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #121411;
}

.corner-cell {
    left: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.lane-head {
    padding: 10px;
}

.lane-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.lane-title-button {
    width: 100%;
    justify-content: flex-start;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #0d0e0d;
    color: var(--ink);
    padding: 5px 7px;
    text-align: left;
}

.lane-title-button:hover,
.lane-title-button:focus {
    border-color: var(--accent);
    color: var(--accent);
    outline: none;
}

.lane-voice-cue {
    margin-left: auto;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    padding: 2px 4px;
    text-transform: uppercase;
}

.lane-title-button:hover .lane-voice-cue,
.lane-title-button:focus .lane-voice-cue {
    border-color: var(--accent);
    color: var(--accent);
}

.lane-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--accent);
}

.lane-name {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
    text-transform: uppercase;
}

.lane-head-row {
    display: flex;
    align-items: stretch;
    gap: 5px;
}

.lane-head-row .lane-title-button {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

.lane-head-row .lane-action-button {
    flex: 0 0 auto;
}

.lane-action-button {
    min-height: 24px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #0d0e0d;
    color: var(--ink);
    font-size: 10px;
    font-weight: 800;
    padding: 0 7px;
}

.lane-action-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.lane-action-button.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.lane-action-button:disabled {
    cursor: default;
    opacity: 0.45;
}

.lane-action-button:disabled:hover {
    border-color: var(--line);
    color: var(--ink);
}

.lane-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.lane-pill {
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--muted);
    font-size: 10px;
    padding: 3px 5px;
    text-transform: uppercase;
}

.step-label {
    position: sticky;
    left: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    min-height: 42px;
    background: #121411;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.step-label.in-loop {
    color: var(--ink);
}

.step-label.playing {
    background: var(--accent);
    color: var(--bg);
}

.step-label.paused {
    background: rgba(74, 155, 139, 0.28);
    color: var(--accent-2);
}

.step-cell {
    min-height: 42px;
    display: flex;
    gap: 6px;
    padding: 6px;
    background: #10120f;
}

.step-button {
    min-width: 0;
    flex: 1;
    height: 100%;
    min-height: 29px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: var(--panel-2);
    color: var(--muted);
    padding: 5px 8px;
    text-align: left;
}

.step-copy-button,
.step-use-button,
.step-clear-button {
    width: 42px;
    min-height: 29px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #0d0e0d;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.step-button:hover,
.step-button:focus,
.step-copy-button:hover,
.step-copy-button:focus,
.step-use-button:hover,
.step-use-button:focus,
.step-clear-button:hover,
.step-clear-button:focus {
    border-color: var(--accent);
    outline: none;
}

.step-cell:hover .step-button:not(.held) {
    border-color: var(--accent);
    background: rgba(217, 154, 58, 0.12);
    color: var(--ink);
}

.step-copy-button:hover:not(:disabled),
.step-use-button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.step-clear-button:hover:not(:disabled) {
    border-color: var(--danger);
    color: var(--danger);
}

.step-copy-button:disabled,
.step-use-button:disabled,
.step-clear-button:disabled {
    cursor: default;
    opacity: 0.45;
}

.step-copy-button:disabled:hover,
.step-use-button:disabled:hover,
.step-clear-button:disabled:hover {
    border-color: var(--line);
    color: var(--muted);
}

.step-button.selected {
    border-color: var(--accent);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.step-button.populated {
    color: var(--ink);
}

.step-button.in-loop {
    border-color: rgba(217, 154, 58, 0.12);
}

.step-button.playing {
    border-color: var(--accent);
    background: rgba(217, 154, 58, 0.18);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.step-button.paused {
    border-color: var(--accent-2);
    background: rgba(74, 155, 139, 0.14);
    color: var(--accent-2);
    box-shadow: inset 0 0 0 1px rgba(74, 155, 139, 0.45);
}

.step-button.held {
    cursor: default;
    border-color: rgba(74, 155, 139, 0.45);
    background: rgba(74, 155, 139, 0.08);
}

.step-index {
    color: var(--muted);
    font-size: 10px;
}

.chord-mark {
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-mark {
    color: #565b51;
    letter-spacing: 0.08em;
}

.hold-mark {
    color: var(--accent-2);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lane-square .lane-dot {
    background: var(--lane-square);
}

.lane-sine .lane-dot {
    background: var(--lane-sine);
}

.lane-sawtooth .lane-dot {
    background: var(--lane-sawtooth);
}

.lane-triangle .lane-dot {
    background: var(--lane-triangle);
}

@media (max-width: 760px) {
    .app-bar {
        grid-template-columns: 1fr;
    }

    .transport {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .brand {
        width: 100%;
    }

    .workspace {
        padding: 10px;
    }

    .lane-tabs {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .lane-tab {
        min-height: 34px;
        flex: 0 0 auto;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #0d0e0d;
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
        padding: 0 12px;
        text-transform: uppercase;
    }

    .lane-tab.active,
    .lane-tab:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

    .desktop-tracker-panel {
        display: none;
    }

    .mobile-tracker-panel {
        display: block;
    }

    .tracker-grid {
        min-width: 0;
    }
}
/* Web UI aesthetic pass */
.app-shell {
    background: var(--bg);
}

.app-bar,
.transport {
    border-bottom: 1px solid var(--line-2);
    background: linear-gradient(180deg, #0d1018 0, var(--bg) 100%);
}

.app-bar {
    min-height: 62px;
}

.brand {
    position: relative;
    grid-template-columns: 22px minmax(0, 1fr);
    column-gap: 14px;
    align-items: center;
}

.brand::before {
    content: "";
    width: 22px;
    height: 22px;
    grid-row: 1 / span 2;
    background: var(--hot);
    clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
}

.brand-title {
    font-size: 18px;
    letter-spacing: 0.22em;
    line-height: 1;
}

.brand-sub {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.transport-button,
.transport-readout,
.transport-step-group,
.transport-field,
.tool-button,
.editor-button,
.editor-toggle,
.mixer-toggle,
.degree-button,
.degree-nudge,
.file-button,
.editor-select,
.editor-field input,
.mixer-voice-button,
.voice-preset-button,
.lane-title-button,
.lane-action-button,
.step-copy-button,
.step-use-button,
.step-clear-button,
.lane-tab {
    border-color: var(--line-2);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.transport-readout,
.transport-step-group,
.transport-field,
.mixer-row,
.midi-row,
.settings-note,
.help-item,
.selected-degree,
.resolved-notes,
.project-message,
.global-conflict,
.editor-conflict {
    border-radius: 0;
    background: var(--field);
}

.transport-button:hover,
.tool-button:hover,
.transport-step-button:hover,
.transport-step-button.active,
.editor-button:hover,
.editor-toggle:hover,
.mixer-toggle:hover,
.degree-button:hover,
.degree-nudge:hover,
.file-button:hover,
.editor-select:hover,
.editor-field input:hover,
.mixer-voice-button:hover,
.voice-preset-button:hover,
.voice-preset-button.selected,
.lane-title-button:hover,
.lane-title-button:focus,
.lane-action-button:hover,
.lane-tab:hover,
.lane-tab.active {
    border-color: var(--hot);
    color: var(--hot);
}

.transport-button.active,
.transport-step-button.active,
.editor-button.selected,
.editor-toggle.on,
.mixer-toggle.on,
.degree-button.on,
.voice-preset-button.selected {
    border-color: var(--hot);
    background: var(--hot);
    color: var(--bg);
}

.transport-button:disabled:hover,
.tool-button:disabled:hover,
.editor-button:disabled:hover,
.degree-nudge:disabled:hover,
.lane-action-button:disabled:hover,
.step-copy-button:disabled:hover,
.step-use-button:disabled:hover,
.step-clear-button:disabled:hover {
    border-color: var(--line-2);
    color: var(--ink);
}

.transport-step-button {
    border-radius: 0;
    background: var(--field);
    color: var(--muted);
    letter-spacing: 0.12em;
}

.transport-label,
.editor-context,
.section-label,
.editor-field span,
.mixer-value,
.transport-step-group .transport-label {
    color: var(--muted);
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.transport-value,
.transport-field input,
.editor-summary,
.selected-degree-label,
.chord-mark,
.help-title {
    color: var(--hot);
}

.transport-value,
.transport-field input,
.resolved-notes,
.step-index,
.mixer-value,
.selected-degree-label,
.chord-mark,
.hold-mark,
.empty-mark,
.lane-pill,
.midi-field input,
.editor-field input,
.editor-select,
.transport-step-button {
    font-family: var(--mono);
}

.workspace {
    background: var(--bg);
}

.tracker-panel,
.chord-editor,
.settings-panel,
.defaults-panel {
    border-color: var(--line-2);
    border-radius: 0;
    background: var(--panel);
}

.tracker-panel {
    box-shadow: inset 0 1px 0 rgba(255, 45, 122, 0.12);
}

.chord-editor,
.settings-panel,
.defaults-panel {
    box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.12), -18px 0 48px rgba(0, 0, 0, 0.55);
}

.defaults-panel {
    box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.14), 0 24px 80px rgba(0, 0, 0, 0.55);
}

.defaults-panel .settings-section:last-child {
    border-bottom: 0;
}

.drawer-scrim {
    background: rgba(4, 6, 10, 0.72);
}

.editor-head,
.settings-section,
.editor-clear-actions {
    border-color: var(--line-2);
}

.editor-title {
    font-size: 18px;
    letter-spacing: 0.2em;
}

.editor-field input,
.editor-select,
.transport-field input {
    outline: none;
}

.editor-field input:focus,
.editor-select:focus,
.transport-field:focus-within {
    border-color: var(--hot);
}

.resolved-notes,
.project-message {
    color: var(--cyan);
}

.global-conflict,
.editor-conflict {
    border-color: rgba(255, 51, 68, 0.6);
    background: rgba(255, 51, 68, 0.08);
    color: #ffb8bf;
}

.mixer-row,
.midi-row,
.help-item,
.settings-note {
    border-color: var(--line-2);
}

.mixer-name {
    letter-spacing: 0.16em;
}

.mixer-volume input {
    accent-color: var(--hot);
}

.voice-preset-button.selected {
    color: var(--bg);
}

.degree-grid {
    gap: 5px;
}

.degree-button,
.degree-nudge {
    font-family: var(--mono);
}

.degree-button.on {
    color: var(--bg);
}

.tracker-grid {
    background: var(--line);
}

.corner-cell,
.lane-head,
.step-label {
    background: var(--bg-deep);
}

.corner-cell,
.lane-head,
.step-label,
.step-cell {
    border-color: var(--line);
}

.corner-cell {
    letter-spacing: 0.22em;
}

.lane-title-button {
    background: var(--field);
}

.lane-title-button:hover .lane-voice-cue,
.lane-title-button:focus .lane-voice-cue {
    border-color: var(--hot);
    color: var(--hot);
}

.lane-voice-cue,
.lane-pill {
    border-radius: 0;
    border-color: var(--line-2);
    letter-spacing: 0.16em;
}

.lane-dot {
    border-radius: 0;
    box-shadow: 0 0 10px currentColor;
}

.lane-action-button.danger:hover,
.editor-button.danger:hover,
.step-clear-button:hover:not(:disabled) {
    border-color: var(--danger);
    color: var(--danger);
}

.step-cell {
    background: var(--bg);
}

.step-button {
    border-radius: 0;
    background: var(--panel-2);
    color: var(--muted);
}

.step-button:hover,
.step-button:focus {
    border-color: var(--ink);
    outline: none;
}

.step-cell:hover .step-button:not(.held) {
    border-color: var(--ink);
    background: var(--panel-2);
    color: var(--ink);
}

.step-button.selected {
    border-color: var(--hot);
    box-shadow: inset 0 0 0 1px var(--hot), 0 0 0 1px rgba(255, 45, 122, 0.18);
}

.step-button.in-loop {
    border-color: rgba(255, 45, 122, 0.12);
}

.step-button.playing,
.step-label.playing {
    border-color: var(--lime);
    background: rgba(191, 255, 0, 0.16);
    color: var(--lime);
    box-shadow: inset 0 0 0 1px rgba(191, 255, 0, 0.55);
}

.step-label.playing {
    background: var(--lime);
    color: var(--bg);
}

.step-button.paused,
.step-label.paused {
    border-color: var(--cyan);
    background: rgba(0, 212, 255, 0.12);
    color: var(--cyan);
    box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.45);
}

.step-button.held {
    border-color: rgba(0, 212, 255, 0.36);
    background: rgba(0, 212, 255, 0.06);
}

.empty-mark {
    color: var(--dim);
}

.hold-mark {
    color: var(--cyan);
}

.step-copy-button:hover:not(:disabled),
.step-use-button:hover:not(:disabled) {
    border-color: var(--cyan);
    color: var(--cyan);
}

.lane-square .lane-title-button:hover,
.lane-square .lane-title-button:focus,
.lane-square .lane-action-button:hover {
    border-color: var(--lane-square);
    color: var(--lane-square);
}

.lane-sine .lane-title-button:hover,
.lane-sine .lane-title-button:focus,
.lane-sine .lane-action-button:hover {
    border-color: var(--lane-sine);
    color: var(--lane-sine);
}

.lane-sawtooth .lane-title-button:hover,
.lane-sawtooth .lane-title-button:focus,
.lane-sawtooth .lane-action-button:hover {
    border-color: var(--lane-sawtooth);
    color: var(--lane-sawtooth);
}

.lane-triangle .lane-title-button:hover,
.lane-triangle .lane-title-button:focus,
.lane-triangle .lane-action-button:hover {
    border-color: var(--lane-triangle);
    color: var(--lane-triangle);
}

@media (max-width: 760px) {
    .lane-tab {
        border-radius: 0;
        background: var(--field);
    }
}
/* Stable track color identity */
.track-lane-1 {
    --track-color: var(--lane-square);
}

.track-lane-2 {
    --track-color: var(--lane-sine);
}

.track-lane-3 {
    --track-color: var(--lane-sawtooth);
}

.track-lane-4 {
    --track-color: var(--lane-triangle);
}

.track-lane-1 .lane-dot,
.track-lane-2 .lane-dot,
.track-lane-3 .lane-dot,
.track-lane-4 .lane-dot {
    background: var(--track-color);
    color: var(--track-color);
}

.track-lane-1 .lane-title-button:hover,
.track-lane-1 .lane-title-button:focus,
.track-lane-1 .lane-action-button:hover,
.track-lane-1 .mixer-voice-button:hover,
.track-lane-1.lane-tab:hover,
.track-lane-1.lane-tab.active,
.track-lane-2 .lane-title-button:hover,
.track-lane-2 .lane-title-button:focus,
.track-lane-2 .lane-action-button:hover,
.track-lane-2 .mixer-voice-button:hover,
.track-lane-2.lane-tab:hover,
.track-lane-2.lane-tab.active,
.track-lane-3 .lane-title-button:hover,
.track-lane-3 .lane-title-button:focus,
.track-lane-3 .lane-action-button:hover,
.track-lane-3 .mixer-voice-button:hover,
.track-lane-3.lane-tab:hover,
.track-lane-3.lane-tab.active,
.track-lane-4 .lane-title-button:hover,
.track-lane-4 .lane-title-button:focus,
.track-lane-4 .lane-action-button:hover,
.track-lane-4 .mixer-voice-button:hover,
.track-lane-4.lane-tab:hover,
.track-lane-4.lane-tab.active {
    border-color: var(--track-color);
    color: var(--track-color);
}

@media (max-width: 760px) {
    .lane-tabs .lane-tab.active,
    .lane-tabs .lane-tab.active:hover {
        border-color: var(--track-color);
        background: var(--track-color);
        color: var(--bg);
    }
}

.lane-head.track-lane-1 .lane-title-button:hover,
.lane-head.track-lane-1 .lane-title-button:focus,
.lane-head.track-lane-2 .lane-title-button:hover,
.lane-head.track-lane-2 .lane-title-button:focus,
.lane-head.track-lane-3 .lane-title-button:hover,
.lane-head.track-lane-3 .lane-title-button:focus,
.lane-head.track-lane-4 .lane-title-button:hover,
.lane-head.track-lane-4 .lane-title-button:focus {
    border-color: var(--track-color);
    box-shadow: inset 0 0 0 1px var(--track-color);
    color: var(--track-color);
}

.lane-head.track-lane-1 .lane-title-button:hover .lane-voice-cue,
.lane-head.track-lane-1 .lane-title-button:focus .lane-voice-cue,
.lane-head.track-lane-2 .lane-title-button:hover .lane-voice-cue,
.lane-head.track-lane-2 .lane-title-button:focus .lane-voice-cue,
.lane-head.track-lane-3 .lane-title-button:hover .lane-voice-cue,
.lane-head.track-lane-3 .lane-title-button:focus .lane-voice-cue,
.lane-head.track-lane-4 .lane-title-button:hover .lane-voice-cue,
.lane-head.track-lane-4 .lane-title-button:focus .lane-voice-cue {
    border-color: var(--track-color);
    color: var(--track-color);
}

.mixer-row.track-lane-1,
.mixer-row.track-lane-2,
.mixer-row.track-lane-3,
.mixer-row.track-lane-4,
.midi-row.track-lane-1,
.midi-row.track-lane-2,
.midi-row.track-lane-3,
.midi-row.track-lane-4 {
    border-left: 2px solid var(--track-color);
}

.mixer-row.track-lane-1 .mixer-name,
.mixer-row.track-lane-2 .mixer-name,
.mixer-row.track-lane-3 .mixer-name,
.mixer-row.track-lane-4 .mixer-name,
.midi-row.track-lane-1 .mixer-name,
.midi-row.track-lane-2 .mixer-name,
.midi-row.track-lane-3 .mixer-name,
.midi-row.track-lane-4 .mixer-name {
    color: var(--track-color);
}

/* Track-scoped editor accents */
.step-editor.track-lane-1,
.step-editor.track-lane-2,
.step-editor.track-lane-3,
.step-editor.track-lane-4,
.voice-panel.track-lane-1,
.voice-panel.track-lane-2,
.voice-panel.track-lane-3,
.voice-panel.track-lane-4,
.defaults-panel.track-lane-1,
.defaults-panel.track-lane-2,
.defaults-panel.track-lane-3,
.defaults-panel.track-lane-4 {
    --active-accent: var(--track-color);
}

.step-editor[class*="track-lane-"] .editor-title,
.step-editor[class*="track-lane-"] .section-label,
.step-editor[class*="track-lane-"] .selected-degree-label,
.step-editor[class*="track-lane-"] .resolved-notes,
.voice-panel[class*="track-lane-"] .editor-title,
.voice-panel[class*="track-lane-"] .section-label,
.voice-panel[class*="track-lane-"] .voice-category-label,
.defaults-panel[class*="track-lane-"] .editor-title,
.defaults-panel[class*="track-lane-"] .section-label {
    color: var(--active-accent);
}

.step-editor[class*="track-lane-"] .editor-button:not(.danger):hover,
.step-editor[class*="track-lane-"] .editor-toggle:hover,
.step-editor[class*="track-lane-"] .degree-button:hover,
.step-editor[class*="track-lane-"] .degree-nudge:hover,
.step-editor[class*="track-lane-"] .editor-select:hover,
.step-editor[class*="track-lane-"] .editor-field input:hover,
.voice-panel[class*="track-lane-"] .editor-button:not(.danger):hover,
.voice-panel[class*="track-lane-"] .editor-toggle:hover,
.voice-panel[class*="track-lane-"] .voice-tab:hover,
.voice-panel[class*="track-lane-"] .voice-param-chip:hover,
.voice-panel[class*="track-lane-"] .voice-preset-button:hover,
.defaults-panel[class*="track-lane-"] .editor-button:not(.danger):hover,
.defaults-panel[class*="track-lane-"] .editor-select:hover,
.defaults-panel[class*="track-lane-"] .editor-field input:hover {
    border-color: var(--active-accent);
    color: var(--active-accent);
}

.step-editor[class*="track-lane-"] .editor-button.icon-close:hover,
.voice-panel[class*="track-lane-"] .editor-button.icon-close:hover {
    color: var(--bg);
    background: var(--active-accent);
    border-color: var(--active-accent);
}

.step-editor[class*="track-lane-"] .editor-button.selected,
.step-editor[class*="track-lane-"] .editor-toggle.on,
.step-editor[class*="track-lane-"] .degree-button.on,
.voice-panel[class*="track-lane-"] .editor-toggle.on,
.voice-panel[class*="track-lane-"] .voice-tab.selected,
.voice-panel[class*="track-lane-"] .voice-param-chip.selected,
.voice-panel[class*="track-lane-"] .voice-preset-button.selected {
    border-color: var(--active-accent);
    background: var(--active-accent);
    color: var(--bg);
}

.step-editor[class*="track-lane-"] .editor-select,
.step-editor[class*="track-lane-"] .editor-select:hover,
.step-editor[class*="track-lane-"] .editor-select:focus {
    color: var(--ink);
}

.step-editor[class*="track-lane-"] .editor-select option {
    background: var(--ink);
    color: var(--bg-deep);
}

.voice-panel[class*="track-lane-"] .voice-slider input[type="range"] {
    accent-color: var(--active-accent);
}

.step-editor[class*="track-lane-"] .editor-button:disabled:hover,
.step-editor[class*="track-lane-"] .degree-nudge:disabled:hover,
.voice-panel[class*="track-lane-"] .editor-button:disabled:hover,
.defaults-panel[class*="track-lane-"] .editor-button:disabled:hover {
    border-color: var(--line-2);
    color: var(--ink);
}
/* Step harmonic context display */
.step-button.populated .chord-mark {
    max-width: 100%;
}
/* Chord stack mini tracker */
.chord-stack {
    width: 100%;
    display: grid;
    gap: 4px;
}

.chord-stack-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 28px 24px 24px minmax(42px, 1fr) 24px 24px 24px;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--line-2);
    background: var(--field);
    padding: 4px;
}

.chord-stack-row.empty-stack {
    grid-template-columns: 28px minmax(0, 1fr);
    color: var(--dim);
}

.chord-stack-index,
.chord-stack-degree,
.stack-button {
    font-family: var(--mono);
}

.chord-stack-index {
    color: var(--dim);
    font-size: 10px;
    text-align: center;
}

.chord-stack-degree {
    min-width: 0;
    color: var(--hot);
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stack-button {
    min-width: 0;
    min-height: 22px;
    border: 1px solid var(--line-2);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-size: 10px;
    font-weight: 800;
    padding: 0;
}

.stack-button:hover:not(:disabled) {
    border-color: var(--cyan);
    color: var(--cyan);
}

.stack-button.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.stack-button:disabled {
    cursor: default;
    opacity: 0.38;
}
/* Step editor layout refinements */
.step-editor {
    width: min(480px, 96vw);
}

.step-editor .editor-head {
    align-items: flex-start;
    gap: 10px;
}

.step-editor .editor-head-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
}

.step-editor .editor-head-actions .editor-button {
    white-space: nowrap;
}

/* Match the close button to the prev/next nav buttons (same 34x34 box and
   radius) so the step-editor header trio is uniform. */
.step-editor .editor-head-actions .editor-button.icon-close {
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 6px;
}

.brush-row .editor-toggle,
.editor-actions .editor-toggle {
    white-space: nowrap;
}

.brush-row .editor-toggle {
    min-width: 98px;
}

.editor-actions .arp-toggle {
    min-width: 54px;
}

.chord-stack-row {
    grid-template-columns: 28px 22px 22px minmax(34px, 1fr) 22px 22px 22px;
    gap: 3px;
    overflow: hidden;
}

.chord-stack-row.empty-stack {
    grid-template-columns: 28px minmax(0, 1fr);
}

.chord-stack-row .stack-button {
    width: 100%;
    justify-self: stretch;
}

@media (max-width: 420px) {
    .step-editor {
        width: min(100vw, 100%);
    }

    .step-editor .editor-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .chord-stack-row {
        grid-template-columns: 24px 21px 21px minmax(30px, 1fr) 21px 21px 21px;
        gap: 2px;
    }
}

/* Shared alephnullmedia chrome */
.app-shell {
    grid-template-rows: auto 1fr auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--line-2);
    background: linear-gradient(180deg, #0d1018 0, var(--bg) 100%);
    box-shadow: 0 1px 0 var(--line-2), 0 10px 24px rgba(0, 0, 0, 0.24);
}

.topbar-inner {
    width: 100%;
    padding: 0 16px;
}

.app-bar,
.transport {
    position: static;
    z-index: auto;
    border-bottom: 0;
    background: transparent;
    padding-right: 0;
    padding-left: 0;
}

.app-bar {
    min-height: 62px;
    padding-top: 11px;
    padding-bottom: 11px;
}

.transport {
    justify-content: flex-end;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
    padding-top: 10px;
    padding-bottom: 10px;
}

.app-tools {
    align-items: center;
}

.tool-button.icon {
    min-width: 34px;
    padding: 0 8px;
    font-size: 15px;
    letter-spacing: 0;
    line-height: 1;
}

.transport-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.transport-step-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tool-button .btn-icon,
.transport-button .btn-icon {
    display: inline-block;
    margin-right: 7px;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0;
    vertical-align: -1px;
}

/* Icon-only buttons that hold an inline SVG mask icon directly (no btn-icon
   wrapper): the transfer/settings tools and every close (✕) button. Center
   the icon and give it a fixed size. */
.tool-button.icon,
.editor-button.icon-close {
    display: inline-grid;
    place-items: center;
}

.tool-button.icon .svg-icon {
    width: 14px;
    height: 14px;
}

.editor-button.icon-close .svg-icon {
    width: 14px;
    height: 14px;
}

.transport-button.play {
    width: 104px;
    min-width: 104px;
    background: var(--hot);
    border-color: var(--hot);
    color: var(--bg);
}

.transport-button.play:hover {
    background: #ff5c95;
    border-color: #ff5c95;
    color: var(--bg);
}

.transport-button.play.active {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--bg);
}

.transport-button.play.active:hover {
    background: #5ce6ff;
    border-color: #5ce6ff;
    color: var(--bg);
}

.app-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 9px 18px;
    border-top: 1px solid var(--line-2);
    background: var(--bg-deep);
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.app-footer .license-link {
    cursor: pointer;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    letter-spacing: inherit;
    padding: 0;
    text-decoration: none;
    text-transform: inherit;
    transition: color 0.12s ease;
}

.app-footer .license-link:hover,
.app-footer a.license-link:visited:hover {
    color: var(--hot);
}

.app-footer a.license-link:visited {
    color: var(--muted);
}

.app-footer .fcol-sep {
    margin: 0 0.45em;
    color: var(--dim);
}

@media (max-width: 760px) {
    .topbar-inner {
        padding: 0 12px;
    }

    /* Brand on its own full-width row, tool buttons on the row below. Five
       icon buttons plus "MUSIC TRACKER v1.0.1" don't fit one phone row, so
       stacking keeps the version visible and inline without wrapping. */
    .app-bar {
        gap: 8px;
        grid-template-columns: 1fr;
    }

    .app-tools {
        flex-wrap: wrap;
        gap: 6px;
        margin-left: auto;
        justify-content: flex-end;
    }

    .app-tools .tool-button .btn-text {
        display: none;
    }

    .app-tools .tool-button .btn-icon {
        margin-right: 0;
        font-size: 16px;
    }

    .transport {
        align-items: stretch;
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    /* Two centered rows on phone: site link on top, copyright + rights together
       on the line below. Tighter tracking keeps the copyright line from wrapping
       into a third row. Mirrors the Glitch Image Editor footer. */
    .app-footer {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: baseline;
        column-gap: 7px;
        row-gap: 3px;
        padding: 10px 12px;
        font-size: 10px;
        letter-spacing: 0.08em;
        text-align: center;
    }

    .app-footer .fcol-site {
        flex: 0 0 100%;
        order: 0;
        white-space: nowrap;
    }

    .app-footer .fcol-copy {
        order: 2;
    }

    .app-footer .fcol-license {
        order: 4;
    }

    /* Keep a single separator between copyright and rights (hide the first;
       show the second — the one preceded by another .fcol-sep). */
    .app-footer .fcol-sep {
        display: none;
    }

    .app-footer .fcol-sep ~ .fcol-sep {
        display: inline;
        order: 3;
    }
}

/* Header brand alignment */
.brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand::before {
    content: none;
}

.brand .glyph {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    background: var(--hot);
    clip-path: polygon(0 0, 60% 0, 100% 30%, 100% 100%, 40% 100%, 0 70%);
}

.brand-copy {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.brand-title {
    margin: 0;
    white-space: nowrap;
}

/* Version sits inline beside the title (shown on mobile too). */
.brand-sub {
    white-space: nowrap;
}

/* Track effects controls */
.effects-list,
.effect-group {
    display: grid;
    gap: 8px;
}

.effect-group {
    scroll-margin-top: 126px;
    border: 1px solid var(--line-2);
    background: var(--field);
}

.effect-group-head {
    min-height: 38px;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 8px;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    padding: 0 10px;
    text-align: left;
}

.effect-group-head:hover {
    color: var(--active-accent, var(--hot));
}

.effect-group-head:hover .voice-category-label,
.effect-group.open .effect-group-head .voice-category-label {
    color: var(--active-accent, var(--hot));
}

.effect-group-caret {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line-2);
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 11px;
    line-height: 1;
    transition: color 0.12s ease, border-color 0.12s ease;
}

.effect-group-caret::before {
    content: "";
    width: 12px;
    height: 12px;
    background-color: currentColor;
    -webkit-mask: var(--icon-chevron-right) no-repeat center / contain;
    mask: var(--icon-chevron-right) no-repeat center / contain;
}

.effect-group.open .effect-group-caret::before {
    -webkit-mask-image: var(--icon-chevron-down);
    mask-image: var(--icon-chevron-down);
}

.effect-group-head:hover .effect-group-caret {
    color: var(--active-accent, var(--cyan));
    border-color: var(--active-accent, var(--cyan));
}

.effect-group-count {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 900;
}

.effect-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    align-items: start;
    gap: 8px;
    border-top: 1px solid var(--line-2);
    padding: 10px;
}

.effect-grid.collapsed {
    display: none;
}

.effects-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.effect-control {
    min-width: 0;
    height: 100%;
    display: grid;
    grid-template-rows: 34px auto;
    align-content: start;
    gap: 10px;
    border: 1px solid var(--line-2);
    background: rgba(10, 12, 17, 0.38);
    padding: 8px;
}

.effect-control.enabled {
    border-color: var(--active-accent, var(--hot));
}

.effect-head {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 34px;
}

.effect-head .editor-toggle {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-slider.disabled {
    opacity: 0.48;
}

.voice-slider.disabled input {
    cursor: not-allowed;
}

.custom-steps-field input {
    width: 100%;
}
