/* Import marketing section styles */
@import url('marketing.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Mobile Portrait Rotation Overlay */
.rotation-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(1.5) brightness(1.1);
    -webkit-backdrop-filter: blur(20px) saturate(1.5) brightness(1.1);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

body.rotation-active {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.rotation-content {
    text-align: center;
    color: #ffffff;
    padding: 40px 20px;
    max-width: 320px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 280px;
}

.rotation-top {
    margin-bottom: 30px;
}

.rotation-middle {
    margin-top: 20px;
}

.rotation-icon {
    margin-bottom: 30px;
    animation: rotatePhone 2s ease-in-out infinite;
}

.rotation-icon svg {
    color: #45b3a8;
    filter: drop-shadow(0 4px 8px rgba(69, 179, 168, 0.3));
}

@keyframes rotatePhone {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
    100% { transform: rotate(0deg); }
}

.rotation-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #ffffff;
}

.rotation-message {
    font-size: 16px;
    line-height: 1.5;
    color: #dadada;
    margin: 0;
}

/* Show overlay only on phone portrait (exclude tablets) */
@media (max-width: 480px) and (orientation: portrait) {
    /* TEMP: disabled to allow portrait UI review */
    .rotation-overlay {
        display: none !important;
    }
}


/* Electron window dragging - make header draggable */
.app-header {
    -webkit-app-region: drag;
}

/* Make interactive elements in header non-draggable */
.app-header button,
.app-header .header-logo,
.app-header .header-right {
    -webkit-app-region: no-drag;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: white;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
}

/* Promo Banner - Top Level */
.promo-banner {
    background: #000;
    border-bottom: 1px solid #fff;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    width: 100%;
    margin: 0;
    padding: 0;
}

.promo-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.promo-text {
    font-weight: 500;
    font-size: 14px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.promo-eyebrow {
    color: #ccc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.promo-code {
    background: #eff245;
    color: #000;
    padding: 2px 6px;
    border-radius: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    -webkit-user-select: text;
    user-select: text;
    transition: background 0.2s ease;
    border: 1px solid #000;
}

.promo-code:hover {
    background: #ffed4e;
}

.promo-code.copied {
    background: #4CAF50 !important;
    color: #fff !important;
    animation: copyPulse 0.3s ease-in-out;
}

@keyframes copyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.promo-badge {
    background-color: #eff245;
    color: #000;
    padding: 4px 8px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 10px;
}

.promo-content h4 {
    color: #4ecdc4;
}

.promo-subtext {
    color: #999;
    font-size: 12px;
    font-style: italic;
}

.promo-close {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: transparent;
    border: 1px solid #fff;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    padding: 4px 8px;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 10;
}

.promo-close:hover {
    background: #eff245;
    color: #000;
}

/* Hide banner when disabled */
.promo-banner.hidden {
    display: none;
}

/* Responsive promo banner adjustments */
@media (max-width: 1024px) {
    .promo-banner-content {
        padding: 12px 60px 12px 20px; /* Extra right padding for close button */
    }

    .promo-close {
        right: 10px;
        font-size: 16px;
        padding: 6px 10px;
    }
}

@media (max-width: 768px) {
    .promo-banner-content {
        padding: 15px 50px 15px 15px; /* Even more space on mobile */
    }

    .promo-text {
        font-size: 13px;
        gap: 6px;
    }

    .promo-close {
        right: 8px;
        font-size: 18px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .promo-banner-content {
        padding: 12px 45px 12px 10px;
    }

    .promo-text {
        font-size: 12px;
        gap: 4px;
    }
}

/* Body padding - no adjustment needed for embedded banner */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: calc(125px + env(safe-area-inset-bottom, 0px));
}

/* App Header */
.app-header {
    padding: 20px 0;
    margin-bottom: 20px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.header-left {
    display: none; /* Removed - content moved to About modal */
}

.header-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-right {
    display: none; /* No longer needed */
}

.header-logo {
    max-width: 140px;
    height: auto;
    opacity: 0.9;
}

.app-header h1 {
    display: none; /* Hide by default, logo replaces it */
}


h2 {
    text-align: center;
    font-family: arial;
    margin-bottom: 18px;
    color: #fff;
    font-size: 1.3rem;
}

h3 {
    text-align: center;
    font-family: arial;
    margin-bottom: 0px;
    color: #44b5b7;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.upload-section {
    background: #000;
    border: 1px dashed #fff;
    border-radius: 0;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.upload-section:hover {
    border-color: #eff245;
    background: #111;
}

.upload-section.dragover {
    border-color: #eff245;
    background: #222;
    transform: scale(1.02);
}

/* Control Tabs */
.control-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 0;
    margin-bottom: 0;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    overflow: visible;
}

.tab-btn {
    background: #000;
    border: 1px solid #fff;
    border-bottom: none;
    color: #fff;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.2s ease;
    margin-right: -1px; /* Overlap borders for seamless connection */
    position: relative;
    z-index: 10;
}

.header-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.tab-btn-menu {
    min-width: 46px;
    padding: 6px 10px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hamburger-icon {
    width: 24px;
    height: 18px;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: currentColor;
}

.header-menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 190px;
    background: #0f1114;
    border: 1px solid #fff;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    display: none;
    flex-direction: column;
    z-index: 80;
    overflow: hidden;
}

.header-menu-dropdown.is-open {
    display: flex;
}

.header-menu-item {
    width: 100%;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: #e6ecee;
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
}

.header-menu-item:last-child {
    border-bottom: 0;
}

.header-menu-item:hover {
    background: #eff245;
    color: #000;
}

/* Header hamburger menu is now the primary home for upload/export actions */
.chop-header .chop-buttons-stack #exportBtn,
.chop-header .chop-buttons-stack #uploadNewBtn {
    display: none !important;
}

.tab-btn:hover {
    background: #eff245;
    color: #000;
    transform: translateY(-2px);
}

.tab-btn:last-child {
    margin-right: 0;
}

.chopper-controls {
    display: block;
    background: #000;
    border-radius: 0;
    border: 1px solid #fff;
    padding: 30px;
    margin-bottom: 30px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin-top: 0; /* Connect directly to tabs */
}

.controls-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
}

.header-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}


.app-header {
    text-align: center;
    margin: 0px 0;
}

.app-header h1 {
    margin-bottom: 5px;
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.app-header h5 {
    display: none; /* Hide by default, logo replaces it */
}

.parent-company {
    display: none; /* Will be moved to top-left via HTML restructure */
}

.hayzer-text, .apps-text {
    font-size: 1rem;
    color: #888;
}

.lightning svg {
    width: 18px;
    height: 18px;
    color: #ffff00;
}

/* BPM +/- Button Styling */
.bpm-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bpm-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.bpm-btn {
    background: #000;
    border: 1px solid #fff;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bpm-btn:hover {
    background: #eff245;
    color: #000;
    transform: scale(1.05);
}

.bpm-btn:active {
    background: #d9db3e;
    color: #000;
    transform: scale(0.95);
}

.endpoint-value-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.endpoint-unit {
    font-size: 13px;
    font-weight: 700;
    color: #9aa2a8;
    line-height: 1;
    user-select: none;
}

.bpm-display {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ccc;
    cursor: default;
    text-align: center;
    min-width: 80px;
}

.bpm-display:focus {
    outline: none;
    box-shadow: none;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    width: 100%;
    position: relative;
}

.waveform-top-layout {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    min-width: 0;
    padding: 0 0 20px 0;
}

.waveform-top-layout .waveform-info {
    flex: 1 1 auto;
    min-width: 0;
}

.session-info-panel {
    width: clamp(300px, 46%, 560px);
    min-width: 300px;
    max-width: 560px;
    border: 1px solid #343838;
    background: rgba(255, 255, 255, 0.015);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    align-self: flex-start;
    margin-top: 8px;
}

.session-info-panel .waveform-info-top {
    margin-bottom: 2px;
    justify-content: flex-start;
}

.session-info-panel .zoom-hint {
    margin-left: 8px;
    font-size: 11px;
}

.session-info-panel .position-info {
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 700;
    color: #f1f1f1;
    line-height: 1.2;
}

.session-info-panel .waveform-bpm-status,
.session-info-panel .waveform-key-status {
    margin: 0;
    font-size: 12px;
}

/* Loop toggle in controls-row styling */
.controls-row .loop-switch-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: none;
    background: none;
    align-self: flex-start;
    margin-top: 20px;
}

.controls-row .loop-switch-label {
    color: #dadada;
    font-weight: bold;
    font-size: 10px;
    text-transform: uppercase;
    margin: 0;
}

/* Desktop layout - spread out controls to use available space */
@media (min-width: 1025px) {
    .waveform-top-layout .waveform-info {
        flex: 0 1 auto;
        width: fit-content;
        max-width: 100%;
    }

    .controls-row {
        justify-content: flex-start;
        align-items: flex-start;
        gap: 12px;
        padding: 0;
        margin-bottom: 8px;
        width: fit-content;
    }

    .chopper-controls {
        max-width: 1200px;
        margin: 0 auto 30px auto;
    }

    .endpoint-control {
        min-width: 160px;
        margin-top: 0;
        padding: 8px 10px;
        border: 1px solid #2f3232;
        border-radius:6px;
        background: rgba(255, 255, 255, 0.02);
        gap: 6px;
    }

    .endpoint-control label {
        position: static;
        top: auto;
        left: auto;
        transform: none;
        margin: 0;
        font-size: 11px;
        color: #cfd2d2;
        letter-spacing: 0.03em;
    }

    .waveform-info {
        padding: 20px 10px;
    }

    .waveform-info-top {
        margin-bottom: 2px;
    }

    .position-info {
        margin-bottom: 2px;
    }

    .waveform-bpm-status,
    .waveform-key-status {
        margin: 2px 0;
    }

    .session-info-panel {
        width: fit-content;
        min-width: 0;
        max-width: 520px;
        margin-top: 10px;
    }
}

.endpoint-control {
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    align-items: center;
    gap: 5px;
    position: relative;
    margin-top: 25px;
}

.endpoint-control label {
    color: #fff;
    border: none;
    border-radius: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    pointer-events: none;
    cursor: default;
}

.endpoint-input {
    padding: 12px 16px;
    border: 1px solid #fff;
    border-radius: 0;
    background: #000;
    color: #777;
    font-size: 18px;
    font-weight: bold;
    width: 110px;
    text-align: center;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    pointer-events: none;
    cursor: default;
}

.endpoint-input:focus {
    outline: none;
    border-color: #eff245;
    background: #111;
    transform: scale(1.02);
}

/* Active state when music is uploaded */
.endpoint-input.active,
.waveform-container.has-audio .endpoint-input {
    color: #fff;
}

.bmp-status.active,
.waveform-container.has-audio .bpm-status {
    color: #999;
}

.waveform-container {
    display: block;
    background: #000;
    border-radius: 0;
    padding: 16px 16px 24px 16px;
    margin-bottom: 10px;
    position: relative;
    min-height: 300px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.waveform-info {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    font-size: 12px;
    color: #dadada;
    background: #000;
    padding: 8px 12px;
    border-radius: 0;
    border: 1px solid #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.waveform-info-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.position-info {
    margin-bottom: 4px;
    text-align: left;
}

.audio-filename {
    text-align: center;
    font-weight: bold;
    color: #000;
    background: #eff245;
    padding: 0 0 2px 8px;
    border-radius: 0;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.view-indicator {
    color:#ffffff;
    font-size:13px;
}

.slice-length-info {
    color: #9fb0b8;
    font-size: 12px;
    margin: 2px 0 4px;
}

.session-bpm-tab {
    width: min(100%, 380px);
    max-width: 380px;
    border: 1px solid #3f4b53;
    border-bottom: none;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    background: linear-gradient(180deg, rgba(21, 26, 31, 0.95) 0%, rgba(14, 18, 22, 0.96) 100%);
    padding: 8px 10px 7px;
    margin: 0 0 0;
}

.session-bpm-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.session-bpm-label {
    color: #cad3d8;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.session-bpm-meta .bpm-status {
    position: static;
    transform: none;
    order: 0 !important;
    margin: 0 !important;
    font-size: 11px;
    color: #9fb0b8;
    white-space: nowrap;
}

.session-bpm-controls {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.session-bpm-controls .endpoint-input.bpm-display {
    width: 124px;
    min-width: 124px;
    font-size: 24px;
    line-height: 1;
    padding: 5px 10px;
}

.session-bpm-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.session-bpm-buttons .bpm-btn {
    width: 28px;
    height: 24px;
    font-size: 14px;
}

.zoom-hint {
    font-style: italic;
    opacity: 0.8;
}


.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
}

.waveform-canvas {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 0;
    border: 1px solid #fff;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.waveform-bmp-status {
    text-align: left;
    margin: 5px 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.bmp-label {
    font-weight: bold;
    color: #4ecdc4;
}

.bmp-analysis-status {
    margin-left: 5px;
}

.waveform-key-status {
    white-space: nowrap !important;
    display: block !important;
}

.key-label {
    font-weight: bold;
    color: #ff6b9d;
    display: inline-block !important;
}

.key-display {
    margin-left: 5px;
    display: inline-block !important;
    white-space: nowrap !important;
}

/* BPM Analysis Overlay */
.bpm-analysis-overlay {
    position: absolute;
    top: 0; /* Position relative to canvas wrapper */
    left: 0;
    right: 0;
    bottom: 0; /* Cover entire canvas area */
    background: rgba(0, 0, 0, 0.4);
    border-radius: 0;
    display: none;
    z-index: 1000;
    pointer-events: all;
}

.bpm-analysis-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 40px;
}

/* Blur only the waveform canvas when analyzing */
.bpm-analysis-overlay.active ~ .canvas-wrapper .waveform-canvas {
    filter: blur(3px);
    transition: filter 0.3s ease;
}

.bpm-analysis-content {
    text-align: center;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 30px;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: pulse-fade 1.5s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

@keyframes pulse-fade {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
    100% {
        opacity: 0.6;
        transform: scale(1);
    }
}

.sliding-window {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(78, 205, 196, 0.3);
    border: 2px solid rgb(255 255 14);
    border-radius: 0;
    pointer-events: auto;
    cursor: grab;
    z-index: 10;
}

.sliding-window:active {
    cursor: grabbing;
}

.sliding-window.dragging {
    background: rgba(78, 205, 196, 0.5);
    border-color: #ff6b6b;
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.6);
    transform: scale(1.02);
}

.sliding-window.playing {
    border-color: rgba(255, 0, 0, 0.7) !important;
    transition: all 0.1s ease;
}

.sliding-window.looping {
    background: rgba(255, 107, 107, 0.4) !important;
    border-color: rgba(255, 0, 0, 0.8) !important;
    transition: all 0.1s ease;
    animation: looping-pulse 1s ease-in-out infinite alternate;
}

.sliding-window.snapped {
    border-color: rgba(78, 205, 196, 1) !important;
    box-shadow: 0 0 12px rgba(78, 205, 196, 0.8);
    transform: scale(1.01);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Progress Bar inside sliding window */
.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 0, 0.4); /* Opacitated yellow */
    pointer-events: none;
    transition: none; /* No transition for smooth animation control */
    display: none; /* Hidden by default */
    z-index: 1; /* Above waveform, below handles */
}

@keyframes looping-pulse {
    0% {
        box-shadow: 0 0 15px rgba(255, 107, 107, 0.6);
    }
    100% {
        box-shadow: 0 0 25px rgba(255, 107, 107, 0.9);
    }
}

.resize-handle {
    position: absolute;
    top: 0;
    right: -3px;
    width: 8px;
    height: 100%;
    background: transparent;
    cursor: ew-resize;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 0;
}

.sliding-window:hover .resize-handle {
    opacity: 1;
}

.resize-handle:hover {
    opacity: 1;
    background: transparent;
}

.resize-handle.resizing {
    opacity: 1;
    background: transparent;
}

.drag-handle {
    position: absolute;
    left: 50%;
    width: 20px;
    height: 16px;
    background: #f3f4f4;
    border-radius: 0;
    cursor: grab;
    opacity: 0.8;
    transition: all 0.2s ease;
    transform: translateX(-50%);
    z-index: 25;
    border: 2px solid #000;
}

.drag-handle:hover {
    opacity: 1;
    background: #45b3a8;
    transform: translateX(-50%) scale(1.1);
}

.drag-handle:active, .drag-handle.dragging {
    cursor: grabbing;
    background: #ff6b6b;
    transform: translateX(-50%) scale(1.2);
}

.drag-handle-top {
    top: -12px;
}

.drag-handle-bottom {
    bottom: -12px;
}

.drag-handle-center {
    position: absolute;
    top: 50%;
    left: auto;
    right: -15px;
    width: 30px;
    height: 24px;
    transform: translateY(-50%);
    background: #fcfc7c;
    border: 2px solid #000;
    cursor: ew-resize;
    display: none;
    z-index: 10;
    touch-action: none;
}

.drag-handle-center::after {
    content: "↔";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: #000;
    pointer-events: none;
}

.drag-handle-center:hover {
    background: #fcfc7c;
    transform: translateY(-50%) scale(1.1);
}

.drag-handle-center:active,
.drag-handle-center.resizing {
    background: #fcfc7c;
    transform: translateY(-50%) scale(1.2);
}

/* Mobile touch improvements */
@media (max-width: 1024px) {
    .drag-handle-center {
        width: 44px;
        height: 36px;
        right: -22px;
    }

    .drag-handle-center::after {
        font-size: 16px;
    }
}

/* Mini Waveform Overview */
.mini-waveform-container {
    position: relative;
    margin: 10px 0 5px 0;
    padding: 0 10px;
    display: none;
}

.mini-waveform-canvas {
    width: 100%;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    cursor: pointer;
    touch-action: none;
}

.mini-waveform-canvas.is-scrubbing {
    border-color: #fcfc7c;
}

.mini-waveform-selection {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 40px;
    background: rgba(252, 252, 124, 0.18);
    border-left: 1px solid rgba(252, 252, 124, 0.85);
    border-right: 1px solid rgba(252, 252, 124, 0.85);
    pointer-events: none;
    z-index: 6;
    display: none;
}

.mini-waveform-marker {
    position: absolute;
    top: 0;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #fcfc7c;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 10;
}

.mini-waveform-hint {
    margin-top: 4px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(220, 228, 232, 0.78);
    pointer-events: none;
}

.scrubber-container {
    margin: 15px 0;
    padding: 0 10px;
    display: none;
}

.scrubber-track {
    position: relative;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0;
    cursor: pointer;
}

.scrubber-thumb {
    position: absolute;
    top: -8px;
    width: 24px;
    height: 24px;
    background: #4ecdc4;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.1s ease;
    transform: translateX(-50%);
}

.scrubber-thumb:hover {
    background: #45b3a8;
    transform: translateX(-50%) scale(1.1);
}

.scrubber-thumb:active {
    cursor: grabbing;
    transform: translateX(-50%) scale(1.2);
}

.scrubber-progress {
    height: 100%;
    background: #4ecdc4;
    border-radius: 0;
    transition: width 0.1s ease;
}

.playback-controls {
    border: 1px solid #333;
    border-radius: 0;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: nowrap;
}

.playback-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: 2px solid #fff;
    border-radius: 0;
    background: #000;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease, transform 0.2s ease;
    text-transform: uppercase;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#playStopBtn {
    min-width: 100px;
}

#chopBtn {
    min-width: 120px;
}

#setBeat1Btn {
    min-width: 180px;
}

.btn-primary {
    background: #000;
    border: 2px solid #fff;
    color: #fff;
}

.btn-primary:hover {
    background: #eff245;
    color: #fff !important;
    transform: translateY(-2px);
}

.export-btn-wide:hover {
    color: #000 !important;
}

.btn-danger {
    background: #ff6b6b;
    color: white;
}

.btn-danger:hover {
    background: #5a2c2c;
    transform: translateY(-2px);
}

.btn-success {
    background: #000;
    border: 2px solid #fff;
    color: #fff;
}

.btn-success:hover {
    background: #eff245 !important;
    color: #000 !important;
    transform: translateY(-2px);
}

.btn-success:active {
    background: #4ecdc4 !important;
    color: #000 !important;
    transform: translateY(0) !important;
}

.btn-secondary {
    background: #000;
    border: 2px solid #fff;
    color: #fff;
}

.btn-secondary:hover {
    background: #eff245;
    color: #000;
    transform: translateY(-2px);
}

/* Stop Samples Button - Use red like main stop button */
#stopSamplesBtn:hover {
    background: #ff6b6b !important;
    color: #fff !important;
    transform: translateY(-2px);
}

/* Clear All Button - Red border on hover, no red background */
.chop-header .chop-buttons-stack #clearAllBtn {
  background: transparent !important;
}

.chop-header .chop-buttons-stack #clearAllBtn:hover {
  background: rgba(255, 71, 87, 0.1) !important;
  border-color: #ff4757 !important;
  color: #ff4757 !important;
  transform: none !important;
}

.chop-header .chop-buttons-stack #clearAllBtn:active {
  background: transparent !important;
  border-color: #ff4757 !important;
  color: #ff4757 !important;
  transform: none !important;
}

.chop-header .chop-buttons-stack #clearAllBtn.delete-mode-active {
  border-color: #ff4757 !important;
  color: #ff4757 !important;
  background: rgba(255, 71, 87, 0.1) !important;
}

.chop-header .chop-buttons-stack #clearAllBtn.delete-mode-active.has-selection {
  border-color: #ff4757 !important;
  color: #ff4757 !important;
  background: rgba(255, 71, 87, 0.16) !important;
  box-shadow: 0 0 0 1px rgba(255, 71, 87, 0.35), 0 0 10px rgba(255, 71, 87, 0.2);
}

/* General button disabled state - ensure text stays visible */
.btn:disabled {
    color: #fff !important;
    background: #000 !important;
    border-color: #777 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.btn:disabled:hover {
    color: #fff !important;
    background: #000 !important;
    border-color: #777 !important;
    transform: none !important;
}

.btn-info {
    background: #000;
    border: 2px solid #fff;
    color: #fff;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 0;
}

.btn-info:hover {
    background: #eff245;
    color: #000;
    transform: translateY(-2px);
}

.help-section {
    text-align: center;
    margin-top: 15px;
}

.btn-about {
    background: #000;
    border: 2px solid #fff;
    color: #fff;
    font-size: 14px;
    padding: 8px 16px;
    margin-top: 10px;
    border-radius: 0;
}

.btn-about:hover {
    background: #eff245;
    color: #000;
    transform: translateY(-2px);
}

.btn-keyboard {
    background: #000;
    border: 2px solid #fff;
    color: #fff;
    font-size: 14px;
    padding: 8px 16px;
    margin-left: 10px;
    border-radius: 0;
}

.btn-keyboard:hover {
    background: #eff245;
    color: #000;
    transform: translateY(-2px);
}

.btn-coffee {
    background: #000;
    border: 2px solid #fff;
    color: #fff;
    font-size: 14px;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s ease;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.btn-coffee:hover {
    background: #eff245;
    color: #000;
    transform: translateY(-2px);
}

.settings-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.settings-section h4 {
    color: #44b5b7;
    margin-bottom: 10px;
    font-size: 16px;
}

.setting-item {
    margin-bottom: 10px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #dadada;
    cursor: pointer;
}

.setting-item input[type="checkbox"] {
    transform: scale(1.2);
}

.loop-switch-container {
    display: flex;
    padding: 6px 12px;
    align-items: center;
    gap: 0px;
}

.loop-switch-label {
    color: #dadada;
    font-weight: bold;
    font-size: 13px;
}

.loop-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.loop-switch-track {
    position: relative;
    width: 57px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #777;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.loop-switch-track.active {
    background: rgba(78, 205, 196, 0.3);
    border-color: #4ecdc4;
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.3);
}

.loop-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.loop-switch-thumb.active {
    left: 30px;
    background: #4ecdc4;
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.4);
}

.switch-text {
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.switch-text.off {
    color: #999;
}

.switch-text.on {
    color: #777;
}

.switch-text.off.active {
    color: #777;
}

.switch-text.on.active {
    color: #4ecdc4;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

.loop-switch:hover .loop-switch-track {
    transform: scale(1.05);
}


.bmp-status {
    font-size: 12px;
    color: #777;
    text-align: center;
    white-space: nowrap;
    transition: all 0.3s ease;
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
}

.bpm-status.analyzing {
    color: #ff6b6b;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

.bpm-status.detected {
    color: #51cf66;
}

.bpm-status.error {
    color: #ff6b6b;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

.chop-list {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 18, 0.96);
  border-top: 1px solid #45b3a8;
  border-radius: 0;
  padding: 0 20px calc(10px + env(safe-area-inset-bottom, 0px)) 20px;
  backdrop-filter: blur(10px);
  max-height: 50vh;
  overflow-y: auto;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

.chop-list h3 {
    color: #ffffff;
    margin-bottom: 15px;
    text-align: center;
}

/* Chop header with toggle - now sticky */
.chop-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  padding: 8px 0;
}

.chop-title-row {
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 0 2px;
  border: none;
  border-top: 1px solid rgba(76, 87, 94, 0.9);
  background: rgba(17, 22, 27, 0.72);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.chop-title-row:hover {
  border-top-color: rgba(104, 118, 126, 0.95);
}

.chop-title-row.is-open {
  border-top-color: rgba(63, 227, 220, 0.5);
}

/* Compact chop title */
.chop-title {
  font-size: 16px !important;
  margin: 0 !important;
  font-weight: normal;
  transition: color 0.16s ease, text-shadow 0.16s ease, background-color 0.16s ease;
  border-radius: 0;
  padding: 0;
  margin-left: 0 !important;
  text-align: left;
}

.chop-title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chop-select-all-btn {
  display: none;
  border: 1px solid rgba(123, 133, 140, 0.85);
  background: rgba(255, 255, 255, 0.03);
  color: #d4dde2;
  font-size: 11px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  cursor: pointer;
}

.chop-select-all-btn.visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chop-select-all-btn:hover {
  border-color: #ff4757;
  color: #ff4757;
  background: rgba(255, 71, 87, 0.08);
}

.chop-delete-hint {
  grid-row: 3;
  min-height: 14px;
  margin: -2px 0 2px;
  text-align: center;
  font-size: 11px;
  font-style: italic;
  color: rgba(200, 208, 214, 0.75);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.chop-delete-hint.visible {
  opacity: 1;
}

.chop-title.chop-title-added {
  color: #ffe45a;
  background: rgba(255, 228, 90, 0.13);
  text-shadow: 0 0 10px rgba(255, 228, 90, 0.65);
}

/* Toggle button */
.chop-toggle {
  background: none;
  border: none;
  color: #e5ecef;
  border-radius: 0;
  padding: 0;
  height: 28px;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 30px;
  transform: none;
  line-height: 1;
  font-weight: 400;
  margin-right: 14px;
}

.chop-toggle:hover {
  color: #ffffff;
}


/* Collapsible container */
.chop-container {
  transition: all 0.3s ease;
  overflow: hidden;
}

.chop-container.collapsed {
  height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
}

#stopSamplesBtn {
  margin: 0 auto;
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Container layout - now just centers the grid */
.chop-container {
  display: flex;
  justify-content: center;
}

.chop-items {
  display: grid;
  grid-template-columns: repeat(17, 50px);
  grid-template-rows: repeat(3, 50px);
  gap: 12px;
  justify-content: center;
}

/* Hide the 51st grid square visually but keep spacing */
.chop-item:nth-child(51) {
  background: transparent !important;
  border: none !important;
  opacity: 0 !important;
}

/* Horizontal button stack in header */
.chop-buttons-stack {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
}

/* Override base .btn styles specifically for chop header buttons */
.chop-header .chop-buttons-stack .btn,
.chop-header .chop-buttons-stack .btn-primary,
.chop-header .chop-buttons-stack .btn-secondary,
.chop-header .chop-buttons-stack button {
  width: 76px !important;
  height: 38px !important;
  min-width: 76px !important;
  max-width: 76px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  border-width: 1px !important;
  transition: border-color 0.15s ease, background-color 0.15s ease !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  transform: none !important;
  box-sizing: border-box !important;
}

/* CHOP button distinctive styling - different size */
.chop-header .chop-buttons-stack .center-chop-btn {
  width: 104px !important;
  height: 38px !important;
  min-width: 104px !important;
  max-width: 104px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border-radius: 4px !important;
  transition: border-color 0.15s ease, background-color 0.15s ease !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  background: transparent !important;
  color: #fcfc7c !important;
  border: 1px solid #fcfc7c !important;
  transform: none !important;
  box-sizing: border-box !important;
}

/* CHOP button hover state */
.chop-header .chop-buttons-stack .center-chop-btn:hover {
  background: rgba(252, 252, 124, 0.1) !important;
}

/* CHOP button click animation - brief glow */
.chop-header .chop-buttons-stack .center-chop-btn.clicked {
  animation: chopClickGlow 0.25s ease-out !important;
  box-shadow: 0 0 0 8px rgba(252, 252, 124, 0.5) !important;
}

/* Brief glow animation for CHOP button click */
@keyframes chopClickGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(252, 252, 124, 0.9) !important;
    border-color: #fcfc7c !important;
  }
  40% {
    box-shadow: 0 0 0 10px rgba(252, 252, 124, 0.5) !important;
    border-color: #fcfc7c !important;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(252, 252, 124, 0) !important;
    border-color: #fcfc7c !important;
  }
}

/* Primary buttons (PLAY, EXPORT) */
.chop-header .chop-buttons-stack .btn-primary {
  background: transparent !important;
  border: 1px solid #4ecdc4 !important;
  color: #4ecdc4 !important;
}

.chop-header .chop-buttons-stack .btn-primary:hover {
  background: rgba(78, 205, 196, 0.1) !important;
  transform: none !important;
}

.chop-header .chop-buttons-stack .btn-primary:active {
  border-color: #3ba89c !important;
  transform: none !important;
}

/* Secondary buttons (STOP, UPLOAD, DELETE) */
.chop-header .chop-buttons-stack .btn-secondary {
  background: transparent !important;
  border: 1px solid #4ecdc4  !important;
  color: #4ecdc4  !important;
}

.chop-header .chop-buttons-stack .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: #888 !important;
  transform: none !important;
}

.chop-header .chop-buttons-stack .btn-secondary:active {
  border-color: #aaa !important;
  transform: none !important;
}

/* Play button active state - yellow pulsating border */
.chop-buttons-stack #playStopBtn.playing {
  border: 2px solid #fcfc7c !important;
  color: #fcfc7c !important;
  animation: playingPulse 1.5s ease-in-out infinite;
}

/* Unified play/stop button feedback when stopping */
.chop-buttons-stack #playStopBtn.stopping {
  border: 2px solid #ff4757 !important;
  color: #ff4757 !important;
  background: transparent !important;
}

/* Pulsating animation for playing state */
@keyframes playingPulse {
  0% {
    border-color: #fcfc7c;
    box-shadow: 0 0 0 0 rgba(252, 252, 124, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(252, 252, 124, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(252, 252, 124, 0);
  }
}

/* Chop item styling */
.chop-item {
  background: #000;
  border: 1px solid #fff;
  border-radius: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.chop-item.skeleton {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: default;
}

.skeleton-text {
  display: none; /* Hide text in square skeleton blocks */
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.chop-item.delete-mode {
    border-color: rgba(180, 193, 201, 0.85);
}

.chop-item.delete-mode .chop-icon svg {
    color: #d8e2e8;
}

.chop-item.delete-selected {
    border-color: #ff4757 !important;
    box-shadow: 0 0 0 1px rgba(255, 71, 87, 0.6), 0 0 10px rgba(255, 71, 87, 0.22);
}

.chop-select-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1px solid #c4ced3;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9;
}

.chop-select-dot.selected {
    border-color: #ff4757;
    background: #ff4757;
    box-shadow: 0 0 0 2px rgba(255, 71, 87, 0.25);
}



.chop-item:hover {
    background: #eff245;
    color: #000;
}

.chop-item.delete-mode:hover {
    background: #000;
    color: #fff;
}

.chop-item.delete-mode:hover .chop-icon svg {
    color: #d8e2e8;
}

.chop-item:hover span {
    color: #000;
}

.chop-item:hover .chop-icon svg {
    color: #000;
}

.chop-item.playing {
    background: #000;
    color: #fff;
    border-color: #eff245;
    box-shadow: 0 0 0 1px rgba(239, 242, 69, 0.65), 0 0 10px rgba(239, 242, 69, 0.45);
    animation: chopPreviewPulse 1.4s ease-in-out infinite;
}

.chop-item.playing span {
    color: #fff;
}

.chop-item.playing .chop-icon svg {
    color: #eff245;
}

@keyframes chopPreviewPulse {
    0% {
        box-shadow: 0 0 0 1px rgba(239, 242, 69, 0.75), 0 0 0 0 rgba(239, 242, 69, 0.35);
    }
    70% {
        box-shadow: 0 0 0 1px rgba(239, 242, 69, 0.75), 0 0 0 7px rgba(239, 242, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 1px rgba(239, 242, 69, 0.75), 0 0 0 0 rgba(239, 242, 69, 0);
    }
}

.chop-item span {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chop-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chop-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.chop-item button {
    background: #000;
    color: #fff;
    border: 1px solid #fff;
    border-radius: 0;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chop-item button:hover {
    background: #ff6b6b;
    color: #fff;
}

/* Skeleton placeholder styles */
.chop-item.skeleton {
    background: #000;
    border: 2px dashed #fff;
    opacity: 0.5;
    cursor: default;
}

.chop-item.skeleton:hover {
    background: repeating-linear-gradient(
                    45deg,
                    transparent,
                    transparent 5px,
                    rgba(152, 147, 147, 0.075)6px,
                    rgba(255, 255, 255, 0.19) 7px,
                    transparent 8px
                ) !important;
    transform: none;
}

.skeleton-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    text-align: center;
    width: 100%;
}

@keyframes skeleton-pulse {
    0% {
        opacity: 0.5;
        border-color: rgba(255, 255, 255, 0.1);
    }
    100% {
        opacity: 0.7;
        border-color: rgba(255, 255, 255, 0.3);
    }
}

.logo-container {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
    padding-left: 0;
}

.horizontal-logo {
    height: 60px;
    width: auto;
}

.top-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    margin: 15px 0;
}

.top-controls .position-controls {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0;
}

.snap-section,
.bar-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-label {
    font-size: 12px;
    color: #dadada;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
}

.chop-preview-hint {
    font-size: 12px;
    color: #dadada;
    opacity: 0.6;
    text-align: center;
    margin: 8px 0;
    font-style: italic;
}

.top-controls .nudge-controls {
    display: flex; /* Always visible */
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.3; /* Greyed out by default */
    transition: opacity 0.2s ease;
}

.top-controls .nudge-controls .nudge-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-controls .nudge-controls.active {
    opacity: 1; /* Full opacity when active */
}

.btn-nudge {
    width: 35px;
    height: 35px;
    border: 2px solid #4ecdc4;
    background: transparent;
    color: white;
    border-radius: 0;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-nudge:hover {
    background: rgba(78, 205, 196, 0.2);
    transform: scale(1.05);
}

.btn-nudge.snap-mode {
    border-color: #fcfc7c;
}

.btn-nudge.snap-mode:hover {
    background: rgba(252, 252, 124, 0.2);
}

.btn-nudge:active {
    background: rgba(78, 205, 196, 0.4);
    transform: scale(0.95);
}

.btn-nudge:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-nudge:disabled:hover {
    background: transparent;
    transform: none;
    pointer-events: none;
}

.nudge-label,
.wave-nav-label {
    color: #dadada;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.keyboard-nav-hint {
    color: #888;
    font-size: 10px;
    text-align: center;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.keyboard-nav-hint i[data-lucide] {
    width: 12px;
    height: 12px;
}

.wave-nav-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 15px 0;
}

.wave-nav-controls .wave-nav-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wave-nav-controls .wave-nav-buttons .wave-nav-buttons-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-wave-nav {
    width: 35px;
    height: 35px;
    border: 2px solid #45b3a8;
    background: transparent;
    color: white;
    border-radius: 0;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-wave-nav:hover {
    background: rgba(69, 179, 168, 0.2);
    transform: scale(1.05);
}

.btn-wave-nav:active {
    background: rgba(69, 179, 168, 0.4);
    transform: scale(0.95);
}

.btn-wave-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.waveform-info .position-info {
    text-align: left;
    color: #dadada;
    font-size: 14px;
    font-weight: bold;
    transform: translateX(0px);
}

.top-controls .position-controls .position-info {
    text-align: center;
    color: #dadada;
    font-size: 18px;
}

.keyboard-hint {
    text-align: center;
    color: #ffffffd6;
    margin-top: 15px;
    font-style: arial;
}

.upgrade-text {
    text-align: center;
    background-color: #eff245;
    color: #000;
    padding: 4px 8px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 10px;
}

.upgrade-text a {
    text-decoration: none !important;
    color: inherit;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.upgrade-text a:hover {
    opacity: 0.8 !important;
    text-decoration: none !important;
    transform: scale(1.05);
    background-color: #f5f545 !important;
}

.promo-banner a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.promo-banner a:hover {
    opacity: 0.8;
}

.promo-code a {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
}

.promo-code a:hover {
    color: inherit;
}

.clear-section {
    text-align: center;
}

.export-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 60px;
}

.export-section button {
    margin: 0 !important;
    min-width: 150px;
}

.btn-exporting {
    position: relative;
    pointer-events: none;
}

.btn-exporting::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* iOS Audio Engine Initialization Overlay */
.engine-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.engine-overlay-content {
    text-align: center;
    padding: 40px 20px;
    max-width: 400px;
    width: 100%;
}

.engine-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.engine-logo .hayzer-text {
    color: #fcf095;
}

.engine-logo .lightning {
    margin: 0 8px;
    color: #fcf095;
    animation: pulse 2s infinite;
}

.engine-logo .apps-text {
    color: #dadada;
}

.engine-title {
    font-size: 42px;
    font-weight: 900;
    background: linear-gradient(135deg, #fcf095, #dadada);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.engine-subtitle {
    font-size: 16px;
    color: #dadada;
    font-weight: 300;
    margin-bottom: 30px;
    opacity: 0.9;
}

.engine-description {
    font-size: 18px;
    color: #dadada;
    margin-bottom: 40px;
    opacity: 0.8;
    line-height: 1.4;
}

.engine-start-btn {
    background: linear-gradient(135deg, #fcf095, #e6d980);
    border: none;
    border-radius: 0;
    padding: 20px 40px;
    font-size: 20px;
    font-weight: 700;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(252, 240, 149, 0.3);
    min-width: 200px;
    position: relative;
    overflow: hidden;
}

.engine-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(252, 240, 149, 0.4);
}

.engine-start-btn:active {
    transform: translateY(0);
}

.engine-btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.engine-btn-content i {
    width: 20px;
    height: 20px;
}

.engine-status {
    margin-top: 30px;
    font-size: 14px;
    color: #fcf095;
    opacity: 0.8;
    font-style: italic;
}

/* Hide overlay by default, show only on mobile */
@media (max-width: 768px) and (hover: none) {
    .engine-overlay.show {
        display: flex;
    }
}

/* Pulse animation for lightning bolt */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Custom Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #000000, #0000005e);
    border: 1px solid #dadada;
    border-radius: 0;
    padding: 16px;
    max-width: 650px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    color: rgb(250, 247, 231);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-header {
    font-size: 24px;
    color: #ffffff;
    margin-bottom: 15px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header span {
    flex: 1;
}

.modal-close-x {
    background: none;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: all 0.2s ease;
    margin-left: 10px;
}

.modal-close-x:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.modal-close-x i[data-lucide] {
    width: 20px;
    height: 20px;
    margin: 0;
}

.modal-body {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.modal-body ol,
.modal-body ul {
    padding-left: 25px;
    margin: 15px 0;
}

.modal-body li {
    margin-bottom: 8px;
}

.features-section {
    margin: 20px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.features-section > p {
    grid-column: 1 / -1;
    margin-bottom: 15px;
}

.features-section ul {
    margin: 0;
    padding-left: 18px;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.features-section li {
    margin-bottom: 8px;
    break-inside: avoid;
}

.social-section {
    text-align: center;
    margin: 20px 0 15px 0;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid #E4405F;
    background: transparent;
    color: #E4405F;
    border-radius: 0;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-btn:hover {
    background: rgba(228, 64, 95, 0.2);
    transform: translateY(-2px);
}

.social-btn i[data-lucide] {
    width: 20px;
    height: 20px;
    margin: 0;
}

.hayzer-btn {
    border: none;
    background: transparent;
    color: #ffff00;
    width: auto;
    height: auto;
}

.hayzer-btn:hover {
    background: transparent;
    transform: translateY(-2px);
}

.hayzer-btn .lightning svg {
    width: 40px;
    height: 40px;
    color: #ffff00;
}

.modal-body strong {
    color: #fcfc7c;
}

.modal-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    font-size: 14px;
    color: #aaa;
}

.modal-checkbox input[type="checkbox"] {
    transform: scale(1.2);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 0;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 48px;
    box-sizing: border-box;
}

.modal-btn-cancel {
    background: transparent;
    margin-top: 0px;
    border: 2px solid #ffffff;
    color: white;
}

.modal-btn-cancel:hover {
    background: #5a6268;
}

.modal-btn-continue {
    background: transparent;
    border: 2px solid #ff6b6b;
    color: white;
}

.modal-btn-continue:hover {
    background: #ff5252;
}

/* Grid layout for button containers */
.snap-section .bar-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 6px;
    margin-top: 8px;
    max-width: 280px;
}

.bar-section .bar-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 6px;
    margin-top: 8px;
    max-width: 300px;
    margin-left: auto;
}

.btn-bar {
    padding: 4px 8px;
    border: 2px solid #4ecdc4;
    background: transparent;
    color: white;
    border-radius: 0;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-bar:hover {
    background: rgba(78, 205, 196, 0.2);
    transform: translateY(-1px);
}

.btn-bar.active {
    background: #4ecdc4;
    color: #000;
}

.btn-bar.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-snap {
    padding: 4px 8px;
    border: 2px solid #fcfc7c;
    background: transparent;
    color: white;
    border-radius: 0;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-snap:hover {
    background: rgba(252, 252, 124, 0.2);
    transform: translateY(-1px);
}

.btn-snap.active {
    background: #fcfc7c;
    color: #000;
}

.resize-handle.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Tablet Responsive Styles */
@media (max-width: 1024px) {
    .control-tabs #keyboardBtn {
        display: none;
    }

    .chop-items {
        grid-template-columns: repeat(10, 45px);
        justify-content: center;
    }

    /* Hide keyboard button on tablet and mobile */
    .btn-keyboard {
        display: none;
    }

    /* Header adjustments for tablet */
    .header-center h1 {
        font-size: 2.2rem;
    }

    .header-center h5 {
        font-size: 1.1rem;
    }

    .parent-company {
        font-size: 0.9rem;
    }

    .header-logo {
        max-width: 70px;
    }

    .waveform-container {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 1024px) and (orientation: landscape) {
    .waveform-info {
        padding: 10px;
        height: auto;
        width: auto;
        flex: 1;
    }

    .controls-row {
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 6px;
    }

    .endpoint-control {
        margin-top: 0;
        padding: 6px 8px;
        border: 1px solid #2f3232;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.02);
        gap: 5px;
    }

    .endpoint-control label {
        position: static;
        top: auto;
        left: auto;
        transform: none;
        margin: 0;
        font-size: 10px;
        color: #cfd2d2;
    }

    .endpoint-input {
        width: 92px;
        padding: 9px 12px;
        font-size: 16px;
    }

    .session-info-panel {
        width: 100%;
        min-width: 0;
        max-width: none;
        padding: 8px 10px;
        margin-top: 8px;
    }

    .session-info-panel .position-info {
        font-size: 13px;
    }

    .session-info-panel .waveform-info-top {
        flex-wrap: wrap;
        gap: 3px 6px;
    }

    .session-info-panel .zoom-hint {
        margin-left: 0;
        font-size: 10px;
    }

    .waveform-top-layout {
        gap: 10px;
    }
}

@media (max-width: 900px) and (orientation: portrait) {
    .waveform-top-layout {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}

@media (max-width: 900px) {
    .chop-items {
        grid-template-columns: repeat(8, 45px);
        justify-content: center;
    }

    /* Further header adjustments */
    .app-header {
        padding: 15px 0;
    }

    .header-center h1 {
        font-size: 2rem;
        margin: 8px 0;
    }

    .header-center h5 {
        font-size: 1rem;
    }

    .parent-company {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }

}

/* Mobile Responsive Styles */
@media (max-width: 650px) {
    .container {
        padding: 10px;
    }

    /* Waveform info responsive fixes */
    .waveform-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 10px 12px;
    }

    .waveform-info-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .waveform-info .position-info {
        transform: none;
        font-size: 12px;
        text-align: left;
    }

    .view-indicator {
        font-size: 14px;
    }

    .zoom-hint {
        font-size: 11px;
    }

    /* Header responsive fixes */
    .app-header {
        padding: 15px 0;
    }

    .header-left {
        font-size: 0.9rem;
    }

    .header-logo {
        max-width: 100px;
    }

    .header-right {
        width: 80px; /* Smaller on mobile */
    }

    .controls-header {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .app-title {
        order: -1; /* Put title first on mobile */
    }

    .controls-row {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    /* Keep top tabs inside waveform-info on small screens */
    .control-tabs {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0 0 6px 0;
    }

    .tab-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 7px 8px;
        font-size: 12px;
        text-align: center;
        white-space: nowrap;
    }

    .endpoint-control {
        border: 1px solid #535454;
        border-radius: 6px;
        padding: 12px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }

    .bar-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .playback-controls {
        gap: 10px;
        padding: 0 12px;
    }

    .btn {
        padding: 14px 20px;
        font-size: 14px;
        min-width: 100px;
        flex: 1;
        max-width: 150px;
    }

    .loop-switch-container {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        width: 14%;
        margin-bottom: 10px;
    }

    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
        max-width: none;
    }

    .canvas-wrapper {
        height: 150px;
    }

    .chop-items {
        grid-template-columns: 1fr 1fr;
    }

    .top-controls .position-controls {
        flex-direction: column;
        gap: 15px;
    }

    .top-controls .nudge-controls {
        order: -1;
    }

}

@media (max-width: 420px) {
    .tab-btn {
        padding: 6px 6px;
        font-size: 11px;
    }
}

/* Notification styles */
.error-notification,
.success-notification,
.loading-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    max-width: 400px;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.error-notification {
    background: linear-gradient(135deg, #ff4757, #ff3838);
    border: 2px solid #ff6b6b;
    color: white;
    display: flex;
    align-items: flex-start;
    padding: 16px;
}

.success-notification {
    background: linear-gradient(135deg, #2ed573, #20bf6b);
    border: 2px solid #4ecdc4;
    color: white;
    padding: 12px 16px;
}

.loading-notification {
    background: linear-gradient(135deg, #4ecdc4, #45b3a8);
    border: 2px solid #4ecdc4;
    color: white;
    padding: 12px 16px;
}

.error-content,
.success-content {
    flex: 1;
}

.error-content h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.error-content p,
.success-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.error-details {
    font-size: 13px !important;
    opacity: 0.9;
    margin-top: 8px !important;
}

.error-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    margin-left: 12px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.error-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .error-notification,
    .success-notification,
    .loading-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    /* Extra small phone header fixes */
    .header-center h1 {
        font-size: 1.8rem;
        margin: 3px 0;
    }

    .header-center h5 {
        font-size: 0.9rem;
        margin: 0;
    }

    .header-center .parent-company {
        font-size: 0.8rem;
        margin-bottom: 3px;
    }

    .lightning svg {
        width: 14px;
        height: 14px;
    }

    .header-logo {
        max-width: 80px;
    }


    .playback-controls {
        flex-direction: column;
        padding: 12px;
        gap: 10px;
    }

    .btn {
        width: 100%;
        max-width: none;
        padding: 16px 20px;
    }

    .loop-switch-container {
        order: -1;
        margin-bottom: 15px;
        padding: 15px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 0;
    }

    .controls-header {
        justify-content: center;
    }

    .chop-items {
        grid-template-columns: 1fr;
        gap: 8px;
    }


    .waveform-container {
        min-height: 250px;
        padding: 15px 15px 30px 15px;
        margin-bottom: 40px;
    }
}

/* Upgrade Modal Styles */
.upgrade-options {
    margin: 20px 0;
}

.upgrade-option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 20px;
    margin-bottom: 15px;
}

.upgrade-option h4 {
    color: #fcfc7c;
    margin-bottom: 10px;
    font-size: 18px;
}

.freeloader-option {
    background: rgba(255, 100, 100, 0.08) !important;
    border-color: rgba(255, 100, 100, 0.15) !important;
}

.freeloader-option h4 {
    color: #ff9999 !important;
}

.upgrade-divider {
    text-align: center;
    color: #999;
    font-weight: bold;
    margin: 15px 0;
    position: relative;
}

.upgrade-divider::before,
.upgrade-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.upgrade-divider::before {
    left: 0;
}

.upgrade-divider::after {
    right: 0;
}

.promo-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .promo-input-container {
        flex-direction: column;
        align-items: stretch;
    }
}

#promoCodeInput,
#aboutPromoInput {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #4ecdc4;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
    height: 48px;
    box-sizing: border-box;
}

#promoCodeInput:focus,
#aboutPromoInput:focus {
    outline: none;
    border-color: #fcfc7c;
    background: rgba(255, 255, 255, 1);
}

.promo-error {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 10px;
    padding: 8px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 0;
}

.export-count-display {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #999;
}

.modal-btn-primary {
    background: transparent;
    border: 2px solid #eff245;;
    color: white;
    width: 100%;
    margin: 15px 0 15px 0;
}

.modal-btn-primary:hover {
    background: rgba(78, 205, 196, 0.2);
}

/* Hide upgrade modal in desktop version */
.desktop-version #upgradeModal {
    display: none !important;
}

/* About Modal Promo Section */
.promo-section {
    margin: 20px 0;
    padding: 20px;
    background: rgba(78, 205, 196, 0.05);
    border: 1px solid rgba(78, 205, 196, 0.2);
    border-radius: 0;
}

.promo-unlock h4 {
    color: #4ecdc4;
    margin-bottom: 10px;
    font-size: 16px;
}

.promo-unlock p {
    margin-bottom: 15px;
    color: #dadada;
}

/* Hide promo section in desktop version */
.desktop-version #aboutPromoSection {
    display: none !important;
}

/* Keyboard Shortcuts Modal Styles */
.shortcuts-grid {
    display: flex;
    gap: 30px;
    margin: 20px 0;
}

.shortcut-section {
    flex: 1;
}

.shortcut-section h4 {
    color: #4ecdc4;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #4ecdc4;
    font-size: 16px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-item kbd {
    background: rgba(78, 205, 196, 0.2);
    border: 1px solid #4ecdc4;
    border-radius: 0;
    color: #4ecdc4;
    padding: 4px 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
    display: inline-block;
    margin-right: 5px;
}

.shortcut-item span {
    flex: 1;
    text-align: left;
    color: #fff;
    font-size: 14px;
}

/* Modal responsiveness */
@media (max-width: 650px) {
    .modal-content {
        max-width: 95%;
        padding: 20px;
        margin: 10px;
    }

    .features-section ul {
        grid-template-columns: 1fr;
    }

}

/* Responsive keyboard modal */
@media (max-width: 650px) {
    .shortcuts-grid {
        flex-direction: column;
        gap: 20px;
    }

    .shortcut-item {
        padding: 10px 0;
    }

    .shortcut-item kbd {
        min-width: 35px;
        padding: 3px 6px;
        font-size: 11px;
    }
}

/* Mobile Portrait Specific - High Specificity Override */
@media (max-width: 480px) and (orientation: portrait) {
  .chop-items {
    grid-template-columns: repeat(6, 40px);
    gap: 8px;
    justify-content: center;
    max-height: 140px;
    overflow-y: auto;
    padding: 5px;
  }

  /* Reduce sticky menu padding in mobile */
  .chop-list {
    padding: 8px 15px !important;
  }

  /* Mobile chop header adjustments */
  .chop-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 0;
  }

  .chop-title {
    font-size: 12px !important;
    text-align: left;
  }

  .chop-buttons-stack {
    order: 2;
    flex: 1 1 auto;
    justify-content: center;
  }

  .chop-buttons-stack .btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 12px;
  }

  .chop-toggle {
    order: 3;
    flex: 0 0 auto;
    font-size: 12px;
    padding: 4px 8px;
  }

  /* Mobile portrait layout reorganization - override all other rules */
  html body .top-controls .position-controls {
    flex-direction: column !important;
    gap: 20px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Center controls stack goes first */
  html body .top-controls .center-chop-section {
    order: 1 !important;
    max-width: none !important;
    flex: none !important;
  }

  /* Bar section goes second */
  html body .top-controls .bar-section {
    order: 2 !important;
    text-align: center !important;
    max-width: none !important;
  }

  html body .top-controls .bar-section .section-label {
    text-align: center !important;
  }

  html body .top-controls .bar-section .bar-buttons {
    margin-left: 0 !important;
    justify-self: center;
  }

  /* Snap section goes third */
  html body .top-controls .snap-section {
    order: 3 !important;
    text-align: center !important;
    max-width: none !important;
  }

  html body .top-controls .snap-section .bar-buttons {
    justify-content: center !important;
  }

  /* Mobile controls reorganization */
  .controls-row {
    flex-direction: row !important;
    gap: 8px !important;
    align-items: flex-start !important;
    margin-bottom: 15px !important;
    justify-content: 0 !important;
  }

  /* Create a row for endpoint controls on mobile */
  .controls-row .endpoint-control {
    flex: none !important;
    max-width: 100px !important;
    border: 1px solid #535454 !important;
    border-radius: 6px !important;
    padding: 8px !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 5px !important;
    margin: 0 !important;
  }

  /* Smaller input boxes */
  .endpoint-input {
    padding: 8px !important;
    font-size: 14px !important;
    width: 60px !important;
  }

  /* Loop toggle styling in controls-row - mobile */
  .controls-row .loop-switch-container {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 5px !important;
    margin: 0 !important;
    flex: none !important;
    min-width: 60px !important;
    max-width: 60px !important;
    align-self: flex-start !important;
    margin-top: 20px !important;
  }

  .controls-row .loop-switch-label {
    font-size: 10px !important;
    color: #dadada !important;
    text-transform: uppercase !important;
    margin: 0 !important;
  }

  /* Smaller buttons */
  .bmp-btn, .bpm-btn {
    padding: 4px 6px !important;
    font-size: 12px !important;
  }

  /* BPM status text smaller */
  .bmp-status, .bpm-status {
    font-size: 10px !important;
  }

  /* Don't add title text for BPM input since it has status text */
  .bpm-input-container::before {
    content: none;
    display: none;
  }

  /* Stack input containers vertically */
  .bpm-input-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 5px !important;
  }

  /* Override input box size for better mobile fit */
  .endpoint-input {
    padding: 6px !important;
    font-size: 14px !important;
    width: 50px !important;
    text-align: center !important;
  }

  /* Stack button groups below inputs */
  .bpm-buttons {
    display: flex !important;
    gap: 3px !important;
  }

  /* Override button sizes for mobile */
  .bpm-btn {
    padding: 3px 6px !important;
    font-size: 12px !important;
    min-width: 20px !important;
  }

  /* Move BPM status text above input */
  .bpm-status {
    order: -1 !important;
    font-size: 10px !important;
    margin-bottom: 5px !important;
  }

  /* Keep loop toggle in center-chop-section but make it more prominent */
  .center-chop-section .loop-switch-container {
    margin: 10px 0 !important;
  }
}

/* Lucide Icon Styling */
i[data-lucide] {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    vertical-align: middle;
    margin-right: 6px;
}

/* Specific icon sizes for different contexts */
.modal-header i[data-lucide] {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.shortcut-section h4 i[data-lucide] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

.shortcut-item i[data-lucide] {
    width: 14px;
    height: 14px;
    margin-right: 6px;
}

.btn i[data-lucide] {
    width: 16px;
    height: 16px;
    margin-right: 6px;
}

.btn-nudge i[data-lucide],
.btn-wave-nav i[data-lucide] {
    width: 14px;
    height: 14px;
    margin: 0;
}

/* Remove margin for icons that should be standalone */
.btn-keyboard i[data-lucide],
.error-close i[data-lucide] {
    margin: 0;
}

/* Key combination styling */
.key-combo {
    display: flex;
    align-items: center;
    gap: 4px;
}

.key-combo kbd {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ================================
   EXPORT SETTINGS MODAL
   ================================ */

.export-setting-group {
    margin-bottom: 20px;
}

.export-setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #fff;
}

.export-select {
    width: 100%;
    padding: 10px 12px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 0;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.export-select:hover {
    border-color: #777;
}

.export-select:focus {
    outline: none;
    border-color: #4ecdc4;
    box-shadow: 0 0 0 2px rgba(78, 205, 196, 0.2);
}

.export-select option {
    background: #2a2a2a;
    color: #fff;
}

.export-info {
    margin-top: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.export-info p {
    margin: 5px 0;
    color: #ddd;
}

.export-info p:first-child {
    margin-top: 0;
}

#exportCount {
    color: #4ecdc4;
    font-weight: bold;
}

/* ============================== */
/* GUMROAD THEME MODALS */
/* ============================== */

.about-modal {
    max-width: 600px;
    width: 90%;
    background: #000;
    border: 1px solid #fff;
    border-radius: 0;
}

.about-modal .modal-header {
    background: #000;
    border-bottom: 1px solid #fff;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.about-modal .modal-body {
    background: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.help-modal {
    max-width: 600px;
    width: 90%;
    background: #000;
    border: 1px solid #fff;
    border-radius: 0;
}

.help-modal .modal-header {
    background: #000;
    border-bottom: 1px solid #fff;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.help-modal .modal-body {
    background: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.help-modal .modal-body ol li,
.help-modal .modal-body ul li,
.about-modal .modal-body p,
.about-modal .modal-body div {
    color: #ccc;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.help-modal .modal-body strong,
.about-modal .modal-body strong {
    color: #fff;
    font-weight: 600;
}

.keyboard-modal {
    max-width: 600px;
    width: 90%;
    background: #000;
    border: 1px solid #fff;
    border-radius: 0;
}

.keyboard-modal .modal-header {
    background: #000;
    border-bottom: 1px solid #fff;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.keyboard-modal .modal-body {
    background: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.keyboard-modal .shortcut-section h4 {
    color: #fff !important;
    border-bottom: 1px solid #fff !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.keyboard-modal .shortcut-item {
    border-bottom: 1px solid #333 !important;
}

.keyboard-modal .shortcut-item span {
    color: #ccc !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.keyboard-modal .shortcut-item kbd {
    background: transparent !important;
    border: 1px solid #fff !important;
    color: #fff !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    border-radius: 0 !important;
}

/* Theme buttons for about, help and keyboard modals */
.about-modal .modal-btn-primary,
.help-modal .modal-btn-primary,
.keyboard-modal .modal-btn-continue {
    background: #eff245 !important;
    color: #000 !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    box-shadow: none !important;
    text-transform: none;
}

.about-modal .modal-btn-primary:hover,
.help-modal .modal-btn-primary:hover,
.keyboard-modal .modal-btn-continue:hover {
    background: #ffed4e !important;
    transform: none;
    box-shadow: none !important;
}

.about-modal .modal-btn-continue,
.help-modal .modal-btn-continue {
    background: transparent !important;
    border: 1px solid #fff !important;
    color: #fff !important;
    border-radius: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.about-modal .modal-btn-continue:hover,
.help-modal .modal-btn-continue:hover {
    background: #222 !important;
    transform: none;
}

.mission-section,
.version-section,
.contact-section {
    margin: 0 0;
    padding: 15px;
    background: #000;
    border: 1px solid #fff;
    border-radius: 0;
}

.mission-section p,
.contact-section p {
    color: #ccc !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.mission-section strong,
.contact-section strong {
    color: #fff !important;
    font-weight: 600;
}

.export-settings-modal {
    max-width: 600px;
    width: 90%;
    background: #000;
    border: 1px solid #fff;
    border-radius: 0;
}

.export-settings-modal .modal-header {
    background: #000;
    border-bottom: 1px solid #fff;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.export-settings-modal .modal-body {
    background: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.export-settings-modal .export-setting-group label {
    color: #fff !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.export-settings-modal .export-select {
    background: #000 !important;
    border: 1px solid #fff !important;
    color: #fff !important;
    border-radius: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.export-settings-modal .export-select:hover {
    border-color: #ccc !important;
}

.export-settings-modal .export-select:focus {
    border-color: #eff245 !important;
    box-shadow: none !important;
}

.export-settings-modal .export-select option {
    background: #000 !important;
    color: #fff !important;
}

.export-settings-modal .export-info {
    background: #000 !important;
    border: 1px solid #fff !important;
    border-radius: 0 !important;
}

.export-settings-modal .export-info p {
    color: #ccc !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.export-settings-modal .modal-btn-continue {
    background: #eff245 !important;
    color: #000 !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    box-shadow: none !important;
    text-transform: none;
}

.export-settings-modal .modal-btn-continue:hover {
    background: #ffed4e !important;
    transform: none;
    box-shadow: none !important;
}

.export-settings-modal .modal-btn-cancel {
    background: transparent !important;
    border: 1px solid #fff !important;
    color: #fff !important;
    border-radius: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.export-settings-modal .modal-btn-cancel:hover {
    background: #222 !important;
    transform: none;
}

/* Rounded corners for all modals */
.modal-overlay .modal-content {
    border-radius: 14px !important;
}

.modal-overlay .modal-header {
    border-top-left-radius: 14px !important;
    border-top-right-radius: 14px !important;
}

.modal-overlay .modal-close-x,
.modal-overlay .modal-btn {
    border-radius: 8px !important;
}


.version-section h4 {
    color: #fff !important;
    margin-bottom: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.version-section p {
    color: #ccc !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    margin-bottom: 10px;
}

.version-section strong {
    color: #fff !important;
    font-weight: 600;
}

.version-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.version-features li {
    color: #ccc !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    margin-bottom: 8px;
    padding-left: 0;
}

/* ====================================
   HORIZONTAL POSITION CONTROLS WITH CENTER CHOP
   ==================================== */

/* Center section - Chop button */
.center-chop-section {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 15px;
}

.center-chop-btn {
    background: transparent !important;
    border: 2px solid #fcf095 !important;
    color: #ffffff !important;
    font-size: 20px !important;
    font-weight: bold !important;
    padding: 15px 25px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    min-width: 120px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.center-chop-btn:hover {
    color: #d3d3d3 !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4) !important;
}

.center-chop-btn:active {
    transform: translateY(0) scale(1.05) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #fcf095 !important;
}

/* Enhanced click animation for CHOP button to match 'C' key behavior */
.center-chop-btn.clicked {
    transform: scale(1.08) !important;
    transition: transform 0.1s ease !important;
}


/* Center column with vertical button stack */
.center-chop-section {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Stack all center controls vertically */
.center-controls-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Hide the separate playback-controls section */
.playback-controls {
    display: none;
}

/* Professional center button styling */
.center-controls-stack .btn {
    min-width: 120px !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Compact professional loop switch */
.center-controls-stack .loop-switch-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 120px;
    justify-content: center;
}

/* Side navigation controls styling */
.section-nav-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid #333;
}

.nav-buttons-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-label {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    margin: 0 8px;
}


/* Nav-bar specific nudge button styling */
.nav-bar .btn-nudge {
    border-color: #687079 !important;
    background: #24282b !important;
    color: #c2c8cc !important;
    box-shadow: 0 4px 0 #0a0a0a;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.1s ease, border-color 0.1s ease;
}

.nav-bar .btn-nudge:hover {
    border-color: #7a838d !important;
    background: rgba(145, 156, 167, 0.18) !important;
    transform: translateY(0) !important;
}

.nav-bar .btn-nudge.snap-mode {
    border-color: var(--dock-yellow) !important;
    color: var(--dock-yellow) !important;
}

.nav-bar .btn-nudge.snap-mode:hover {
    border-color: var(--dock-yellow) !important;
    background: rgba(242, 222, 83, 0.2) !important;
    transform: translateY(0) !important;
}

.nav-bar .btn-wave-nav {
    border-color: var(--dock-teal) !important;
    background: #24282b !important;
    box-shadow: 0 4px 0 #0a0a0a;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.1s ease, border-color 0.1s ease;
}

.nav-bar .btn-wave-nav:hover {
    border-color: var(--dock-teal) !important;
    background: rgba(63, 227, 220, 0.2) !important;
    transform: translateY(0) !important;
}

.nav-bar .btn-nudge:active,
.nav-bar .btn-wave-nav:active {
    transform: translateY(2px) !important;
    box-shadow: 0 2px 0 #0a0a0a !important;
}

.nav-hint {
    color: #888;
    font-size: 11px;
    text-align: center;
    font-style: italic;
    margin-top: 4px;
}

/* Make loop switch more compact without text */
.loop-switch-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px;
    border-radius: 5px;
}

.loop-switch {
    display: flex;
    align-items: center;
}

/* Hide any ON/OFF text that might still exist */
.switch-text {
    display: none !important;
}

/* Navigation Bar */
.nav-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 48px;
  padding: 6px 10px;
  background: linear-gradient(180deg, #1f2326 0%, var(--dock-bg) 100%);
  border: 1px solid var(--dock-border);
  border-radius: 12px;
  margin: 6px auto;
  max-width: 1200px;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -8px 16px rgba(0, 0, 0, 0.4);
}

.nav-bar .nudge-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 1 !important;
  grid-column: 1;
  justify-self: start;
}

.nav-bar .position-controls {
  grid-column: 2;
  justify-self: center;
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
}

.nav-bar .position-controls .snap-section,
.nav-bar .position-controls .bar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.nav-bar .bar-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-bar .snap-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-bar .snap-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-bar .snap-controls-row .bar-buttons {
  display: flex;
  align-items: center;
}

.nav-bar .grid-nudge-toggle {
  flex: 0 0 auto;
}

.nav-bar .manual-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--dock-text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-bar .manual-mode-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.nav-bar .manual-mode-toggle .manual-mode-label {
  color: var(--dock-text-dim);
}

.nav-bar .manual-mode-toggle .loop-switch-track {
  width: 57px;
  height: 28px;
}

.nav-bar .manual-mode-toggle .loop-switch-thumb {
  width: 20px;
  height: 20px;
}

.nav-bar .manual-mode-toggle:hover .loop-switch-track {
  transform: scale(1.05);
}

.nav-bar .position-controls .section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--dock-text-dim);
  margin-bottom: 1px;
  white-space: nowrap;
}

.nav-bar .snap-section-header .section-label,
.nav-bar .bar-section-header .section-label {
  margin-bottom: 0;
}

.nav-bar .position-controls .btn-snap,
.nav-bar .position-controls .btn-bar {
  padding: 4px 10px;
  font-size: 11px;
  height: 30px;
  min-width: 34px;
  background: #24282b;
  border-width: 1px;
  box-shadow: 0 4px 0 #0a0a0a;
  transform: translateY(0);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.1s ease, border-color 0.1s ease;
}

/* Manual mode now uses the checkbox toggle in the bar-section header */
#bar-manual {
  display: none !important;
}

.nav-bar .position-controls .btn-snap {
  border-color: var(--dock-yellow);
}

.nav-bar .position-controls .btn-snap:hover {
  background: rgba(242, 222, 83, 0.2);
  transform: translateY(0);
}

.nav-bar .position-controls .btn-snap.active {
  background: var(--dock-yellow);
  color: #101010;
}

.nav-bar .position-controls .btn-bar {
  border-color: var(--dock-teal);
}

.nav-bar .position-controls .btn-bar:hover {
  background: rgba(63, 227, 220, 0.2);
  transform: translateY(0);
}

.nav-bar .position-controls .btn-bar.active {
  background: var(--dock-teal);
  color: #101010;
}

/* When manual mode is active, mute all bar-loop preset buttons */
.waveform-container.manual-mode-active .nav-bar .position-controls .btn-bar,
.waveform-container.manual-mode-active .waveform-container#waveformContainer .nav-bar .position-controls .btn-bar {
  border-color: #5f666d !important;
  background: #23292f !important;
  color: #aeb5bb !important;
}

.waveform-container.manual-mode-active .nav-bar .position-controls .btn-bar:hover,
.waveform-container.manual-mode-active .waveform-container#waveformContainer .nav-bar .position-controls .btn-bar:hover {
  border-color: #6a7178 !important;
  background: #2a3036 !important;
  color: #bcc3c8 !important;
  transform: translateY(0) !important;
}

.waveform-container.manual-mode-active .nav-bar .position-controls .btn-bar.active,
.waveform-container.manual-mode-active .waveform-container#waveformContainer .nav-bar .position-controls .btn-bar.active {
  border-color: #737a81 !important;
  background: #2f363d !important;
  color: #d2d8dd !important;
}

.nav-bar .position-controls .btn-snap:active,
.nav-bar .position-controls .btn-bar:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #0a0a0a;
}

.nav-bar .bar-buttons,
.nav-bar .snap-section .bar-buttons {
  gap: 3px;
}

@media (min-width: 769px) {
  .nav-bar {
    gap: 18px;
  }

  .nav-bar .nudge-controls {
    margin-right: 6px;
  }

  .nav-bar .position-controls {
    gap: 20px;
  }

  .nav-bar .nudge-controls .nudge-buttons,
  .nav-bar .wave-nav-buttons .wave-nav-buttons-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .nav-bar .nudge-controls,
  .nav-bar .wave-nav-buttons {
    flex-direction: row;
  }

  .nav-bar .position-controls .bar-buttons,
  .nav-bar .position-controls .snap-section .bar-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: 0;
    max-width: none;
    margin-left: 0;
  }
}

.nav-bar .wave-nav-buttons {
  display: flex;
  align-items: center;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  grid-column: 3;
  justify-self: end;
}

.nav-bar .wave-nav-buttons .btn-wave-zoom {
  width: auto;
  min-width: 92px;
  padding: 0 10px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-color: #5c6670 !important;
  color: #aeb8bf !important;
  background: linear-gradient(180deg, #2b3137 0%, #20262c 55%, #1a1f24 100%) !important;
}

.nav-bar .wave-nav-buttons .btn-wave-zoom.active {
  border-color: #f2de53 !important;
  color: #f2de53 !important;
  background: rgba(242, 222, 83, 0.16) !important;
  box-shadow: 0 0 0 1px rgba(242, 222, 83, 0.2) inset;
}

.nav-bar .wave-nav-buttons.no-scroll .wave-nav-label {
  opacity: 0.6;
}

.nav-bar .wave-nav-buttons .keyboard-nav-hint {
  display: none;
}

.nav-bar .nudge-label,
.nav-bar .wave-nav-label {
  color: var(--dock-text-dim);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.mobile-controls-switcher {
  display: none;
}

.mobile-more-menu {
  display: none;
}

#mobileMoreBtn {
  display: none !important;
}

@media (min-width: 1025px) {
  .nav-bar {
    grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  }

  .nav-bar .position-controls .bar-section {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    column-gap: 8px;
    row-gap: 4px;
    align-items: center;
  }

  .nav-bar .position-controls .bar-section .bar-section-header {
    display: contents;
  }

  .nav-bar .position-controls .bar-section .bar-section-header .section-label {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
  }

  .nav-bar .position-controls .bar-section .bar-buttons {
    grid-column: 1;
    grid-row: 2;
    justify-content: center;
  }

  .nav-bar .position-controls .bar-section .manual-mode-toggle {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    margin: 0;
  }

  .nav-bar .nudge-controls {
    min-width: 180px;
  }

  .nav-bar .nudge-controls .nudge-buttons,
  .nav-bar .wave-nav-buttons .wave-nav-buttons-row {
    gap: 6px;
  }

  .nav-bar .btn-nudge,
  .nav-bar .btn-wave-nav {
    width: 38px;
    height: 32px;
  }

  .nav-bar .wave-nav-buttons .btn-wave-zoom {
    min-width: 86px;
    padding: 0 8px;
    height: 32px;
  }

  .nav-bar .position-controls {
    padding: 0 4px;
  }

  .nav-bar .position-controls .btn-snap,
  .nav-bar .position-controls .btn-bar {
    min-width: 38px;
    height: 32px;
  }

  .nav-bar .wave-nav-buttons {
    min-width: 180px;
    justify-content: flex-end;
  }
}

@media (max-width: 1024px) {
  .nav-bar {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 6px 8px;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
  }

  .nav-bar .position-controls {
    gap: 12px;
    min-width: max-content;
  }

  .nav-bar .position-controls .btn-snap,
  .nav-bar .position-controls .btn-bar {
    min-width: 36px;
    height: 34px;
    font-size: 11px;
  }

  /* Compact layout (phone + tablet): show one controls panel at a time */
  .nav-bar {
    display: block !important;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
    white-space: normal;
  }

  .nav-bar .mobile-controls-switcher {
    display: block;
    margin-bottom: 6px;
  }

  .nav-bar .mobile-controls-modes {
    display: flex;
    gap: 6px;
    align-items: center;
  }

  .nav-bar .mobile-mode-btn {
    flex: 1 1 0;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #4c545b;
    background: #1e242a;
    color: #d0d7da;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
  }

  .nav-bar .mobile-mode-btn.active {
    border-color: rgba(63, 227, 220, 0.8);
    color: #3fe3dc;
    background: rgba(63, 227, 220, 0.12);
  }

  .nav-bar .nudge-controls,
  .nav-bar .position-controls,
  .nav-bar .wave-nav-buttons {
    display: none !important;
  }

  .nav-bar.mobile-mode-nudge .nudge-controls {
    display: flex !important;
    margin-top: 4px !important;
    justify-content: center !important;
  }

  .nav-bar.mobile-mode-nudge .nudge-controls .nudge-buttons {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
  }

  .nav-bar.mobile-mode-nudge .position-controls {
    display: flex !important;
    justify-content: center;
    margin-top: 4px;
  }

  .nav-bar.mobile-mode-nudge .position-controls .bar-section {
    display: none !important;
  }

  .nav-bar.mobile-mode-bar .position-controls {
    display: flex !important;
    justify-content: center;
    margin-top: 4px;
    width: 100%;
    min-width: 0;
  }

  .nav-bar.mobile-mode-bar .position-controls .snap-section,
  .nav-bar.mobile-mode-bar .nudge-controls {
    display: none !important;
  }

  .nav-bar.mobile-mode-bar .position-controls .bar-section {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .nav-bar.mobile-mode-bar .position-controls .bar-buttons {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
}

@media (max-width: 768px) {
  .nav-bar {
    display: block !important;
    padding: 5px 6px;
  }

  .nav-bar .nudge-controls,
  .nav-bar .position-controls,
  .nav-bar .wave-nav-buttons {
    grid-column: auto;
    justify-self: auto;
  }

  .nav-bar .btn-nudge,
  .nav-bar .btn-wave-nav {
    width: 44px;
    height: 44px;
  }

  .nav-bar .position-controls .btn-snap,
  .nav-bar .position-controls .btn-bar {
    min-width: 44px;
    height: 44px;
    font-size: 12px;
  }

  .nav-bar .position-controls .section-label {
    font-size: 9px;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .nav-bar.mobile-mode-bar .position-controls .bar-buttons {
    gap: 4px;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    justify-content: center !important;
    overflow-x: visible;
  }

  .nav-bar.mobile-mode-bar .position-controls .btn-bar {
    min-width: 38px !important;
    height: 36px !important;
    padding: 0 5px !important;
    font-size: 11px !important;
  }
}

/* Controls are now in nav-bar, not position-controls */

/* Nav-bar nudge buttons use existing snap-mode styling */

/* ================================
   Rounded UI Pass
   ================================ */
:root {
    --ui-radius-sm: 8px;
    --ui-radius-md: 10px;
    --ui-radius-lg: 12px;
    --dock-bg: #1a1d1f;
    --dock-border: #2f3639;
    --dock-teal: #3fe3dc;
    --dock-yellow: #f2de53;
    --dock-text-dim: #aeb5b8;
}

.waveform-container,
.waveform-info,
.session-info-panel,
.endpoint-control,
.endpoint-input,
.bpm-btn,
.bmp-btn,
.btn,
.btn-bar,
.btn-snap,
.btn-wave-nav,
.btn-nudge,
.chop-list,
.chop-header,
.audio-filename,
.canvas-wrapper,
.waveform-canvas,
.mini-waveform-canvas,
.scrubber-track,
.scrubber-thumb,
.bpm-input-container {
    border-radius: var(--ui-radius-md) !important;
}

.bpm-btn,
.bmp-btn,
.btn-wave-nav,
.btn-nudge,
.chop-toggle {
    border-radius: var(--ui-radius-sm) !important;
}

.sliding-window,
.progress-bar,
.resize-handle {
    border-radius: var(--ui-radius-sm) !important;
}

/* Tabs: keep only top corners rounded */
.tab-btn {
    border-radius: 0 !important;
    border-top-left-radius: var(--ui-radius-sm) !important;
    border-top-right-radius: var(--ui-radius-sm) !important;
}

/* ================================
   Hardware Chassis Pass (Sandbox)
   ================================ */
.waveform-container#waveformContainer {
    background: radial-gradient(120% 140% at 50% -20%, #32383f 0%, #1a1d21 48%, #121417 100%);
    border: 3px solid #32373d;
    border-radius: 34px;
    padding: 16px 16px 12px;
    margin: 0 auto 12px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      inset 0 -14px 26px rgba(0, 0, 0, 0.55),
      0 14px 38px rgba(0, 0, 0, 0.35);
    isolation: isolate;
}

.waveform-container#waveformContainer::before {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 16px 24px rgba(255, 255, 255, 0.03), inset 0 -18px 30px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 0;
}

.waveform-container#waveformContainer::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 34px;
    background-image:
      radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px),
      radial-gradient(circle at 78% 72%, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px);
    background-size: 3px 3px, 4px 4px;
    mix-blend-mode: soft-light;
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.waveform-container#waveformContainer > * {
    position: relative;
    z-index: 1;
}

.waveform-container#waveformContainer .control-tabs {
    max-width: none;
    margin: 0;
    padding: 0 8px;
    gap: 2px;
    overflow: visible;
    z-index: 25;
}

.waveform-container#waveformContainer .tab-btn {
    background: #111111;
    border: 1px solid #8a9096;
    color: #e9ecef;
    padding: 8px 16px;
    font-size: 13px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.waveform-container#waveformContainer .tab-btn:hover {
    background: linear-gradient(180deg, #838a90 0%, #6d747b 100%);
    color: #fff;
    transform: translateY(-1px);
}

.waveform-container#waveformContainer .waveform-top-layout {
    gap: 12px;
    padding: 10px;
    border: 1px solid #2d3338;
    border-radius: 14px;
    background: linear-gradient(180deg, #20242a 0%, #171a1e 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    flex-wrap: nowrap;
}

.waveform-container#waveformContainer .waveform-info {
    background: transparent;
    border: none;
    padding: 0;
    flex: 0 1 32%;
    max-width: 32%;
    min-width: 0;
}

.waveform-container#waveformContainer .controls-row {
    gap: 8px;
    margin-bottom: 8px;
}

.waveform-container#waveformContainer .endpoint-control {
    margin-top: 0;
    min-width: 126px;
    padding: 8px 8px 6px;
    border: 1px solid rgba(87, 106, 118, 0.7);
    background: linear-gradient(180deg, rgba(10, 18, 22, 0.92) 0%, rgba(9, 12, 15, 0.95) 100%);
    box-shadow: inset 0 0 0 1px rgba(126, 146, 158, 0.1), 0 2px 8px rgba(0, 0, 0, 0.28);
}

.waveform-container#waveformContainer .endpoint-control label {
    position: static;
    transform: none;
    margin: 0 0 3px;
    font-size: 10px;
    letter-spacing: 0.04em;
    color: #b8c2c7;
}

.waveform-container#waveformContainer .endpoint-input {
    background: #0f1418;
    border: 1px solid #52616b;
    color: #d3dbe0;
    width: 88px;
    font-size: 28px;
    line-height: 1;
    padding: 8px 8px;
}

.waveform-container#waveformContainer .endpoint-input.bpm-display {
    font-size: 28px;
}

.waveform-container#waveformContainer .endpoint-unit {
    font-size: 12px;
    color: #8ea4b1;
}

.waveform-container#waveformContainer .bpm-btn,
.waveform-container#waveformContainer .bmp-btn {
    border-color: #4f565d;
    background: #1f252b;
}

.waveform-container#waveformContainer .session-info-panel {
    width: min(100%, 380px);
    min-width: 0;
    max-width: 380px;
    padding: 12px 14px;
    border: 1px solid #3fe3dc;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(12, 17, 21, 0.95) 0%, rgba(10, 14, 18, 0.98) 100%);
    box-shadow: inset 0 0 0 1px rgba(63, 227, 220, 0.16), 0 0 14px rgba(63, 227, 220, 0.2);
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    border-top-left-radius: 0;
    margin-top: 0;
}

.waveform-container#waveformContainer .marketing-section {
    flex: 0 1 68%;
    min-width: 0;
    max-width: 68%;
}

.waveform-container#waveformContainer .session-bpm-tab {
    width: min(100%, 380px);
    max-width: 380px;
}

.waveform-container#waveformContainer .session-info-panel .view-indicator,
.waveform-container#waveformContainer .session-info-panel .slice-length-info,
.waveform-container#waveformContainer .session-info-panel #totalTimeDisplay,
.waveform-container#waveformContainer .session-info-panel #sliceLengthDisplay {
    color: #fff4a3;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.waveform-container#waveformContainer .session-info-panel .waveform-bpm-status,
.waveform-container#waveformContainer .session-info-panel .waveform-key-status {
    color: #87b2b4;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.waveform-container#waveformContainer .session-info-panel .position-info {
    color: #e7ecee;
    font-weight: 700;
    font-size: 12px;
    margin: 4px 0;
}

.waveform-container#waveformContainer .session-info-panel .bmp-label,
.waveform-container#waveformContainer .session-info-panel .key-label {
    color: #f2de53;
    letter-spacing: 0.04em;
}

.waveform-container#waveformContainer .session-info-panel .bpm-analysis-status,
.waveform-container#waveformContainer .session-info-panel .bmp-analysis-status,
.waveform-container#waveformContainer .session-info-panel .key-display {
    color: #fff;
}

.waveform-container#waveformContainer .canvas-wrapper {
    height: 280px;
    margin-top: 8px;
    border: 2px solid #0b0d0f;
    border-radius: 14px;
    background: radial-gradient(80% 140% at 50% 10%, #181b1f 0%, #0f1114 70%, #0c0e10 100%);
    box-shadow: inset 0 0 0 1px rgba(63, 227, 220, 0.15);
    overflow: hidden;
}

.waveform-container#waveformContainer .canvas-wrapper::before,
.waveform-container#waveformContainer .canvas-wrapper::after {
    content: "";
    position: absolute;
    top: 34px;
    bottom: 34px;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, rgba(63, 227, 220, 0.1) 0%, rgba(63, 227, 220, 0.95) 50%, rgba(63, 227, 220, 0.12) 100%);
    box-shadow: 0 0 10px rgba(63, 227, 220, 0.55);
    opacity: 0.7;
    pointer-events: none;
    z-index: 2;
}

.waveform-container#waveformContainer .canvas-wrapper::before {
    left: 10px;
}

.waveform-container#waveformContainer .canvas-wrapper::after {
    right: 10px;
}

.waveform-container#waveformContainer .canvas-wrapper.drag-edge-left::before {
    opacity: 1;
    box-shadow: 0 0 16px rgba(255, 227, 84, 0.95);
    background: linear-gradient(180deg, rgba(255, 227, 84, 0.16) 0%, rgba(255, 227, 84, 1) 50%, rgba(255, 227, 84, 0.2) 100%);
    animation: edge-hit-pulse 0.35s ease-in-out infinite alternate;
}

.waveform-container#waveformContainer .canvas-wrapper.drag-edge-right::after {
    opacity: 1;
    box-shadow: 0 0 16px rgba(255, 227, 84, 0.95);
    background: linear-gradient(180deg, rgba(255, 227, 84, 0.16) 0%, rgba(255, 227, 84, 1) 50%, rgba(255, 227, 84, 0.2) 100%);
    animation: edge-hit-pulse 0.35s ease-in-out infinite alternate;
}

@keyframes edge-hit-pulse {
    from {
        transform: scaleY(0.96);
        filter: saturate(0.95);
    }
    to {
        transform: scaleY(1.04);
        filter: saturate(1.12);
    }
}

.waveform-container#waveformContainer .waveform-canvas {
    border: none;
    border-radius: 0;
    background: transparent;
}

.waveform-container#waveformContainer .nav-bar {
    margin-top: 6px;
    border-radius: 0 0 14px 14px;
    border-top-color: #252a2f;
}

.waveform-container#waveformContainer .nav-bar .position-controls .section-label,
.waveform-container#waveformContainer .nav-bar .nudge-label,
.waveform-container#waveformContainer .nav-bar .wave-nav-label {
    color: #b7c0c3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.09em;
}

.waveform-container#waveformContainer .nav-bar .btn-nudge,
.waveform-container#waveformContainer .nav-bar .btn-wave-nav,
.waveform-container#waveformContainer .nav-bar .position-controls .btn-snap,
.waveform-container#waveformContainer .nav-bar .position-controls .btn-bar {
    background: linear-gradient(180deg, #2b3137 0%, #20262c 55%, #1a1f24 100%) !important;
    border-width: 1px;
    box-shadow: 0 4px 0 #090b0d, inset 0 1px 0 rgba(255, 255, 255, 0.09);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}

.waveform-container#waveformContainer .nav-bar .btn-nudge:hover,
.waveform-container#waveformContainer .nav-bar .btn-wave-nav:hover,
.waveform-container#waveformContainer .nav-bar .position-controls .btn-snap:hover,
.waveform-container#waveformContainer .nav-bar .position-controls .btn-bar:hover {
    filter: brightness(1.12);
}

.waveform-container#waveformContainer .nav-bar .btn-nudge {
    border-color: #687079 !important;
    color: #c2c8cc !important;
}

.waveform-container#waveformContainer .nav-bar .btn-nudge:hover {
    border-color: #7a838d !important;
    background: rgba(145, 156, 167, 0.18) !important;
}

.waveform-container#waveformContainer .nav-bar .btn-nudge.snap-mode {
    border-color: var(--dock-yellow) !important;
    color: var(--dock-yellow) !important;
}

.waveform-container#waveformContainer .nav-bar .btn-nudge.snap-mode:hover {
    border-color: var(--dock-yellow) !important;
    background: rgba(242, 222, 83, 0.2) !important;
}

.waveform-container#waveformContainer .nav-bar .btn-nudge:active,
.waveform-container#waveformContainer .nav-bar .btn-wave-nav:active,
.waveform-container#waveformContainer .nav-bar .position-controls .btn-snap:active,
.waveform-container#waveformContainer .nav-bar .position-controls .btn-bar:active {
    transform: translateY(2px) !important;
    box-shadow: 0 2px 0 #090b0d, inset 0 1px 4px rgba(0, 0, 0, 0.45) !important;
}

.waveform-container#waveformContainer .nav-bar .position-controls .btn-snap.active {
    background: linear-gradient(180deg, #f5e15c 0%, #e6d24d 100%) !important;
    color: #121212;
}

.waveform-container#waveformContainer .nav-bar .position-controls .btn-bar.active {
    background: linear-gradient(180deg, #48e6df 0%, #31d2cb 100%) !important;
    color: #121212;
}

@media (max-width: 1024px) {
    .waveform-container#waveformContainer {
        border-radius: 24px;
        padding: 12px 12px 10px;
    }

    .waveform-container#waveformContainer .waveform-top-layout {
        flex-wrap: wrap;
    }

    .waveform-container#waveformContainer .waveform-info,
    .waveform-container#waveformContainer .marketing-section {
        flex: 1 1 100%;
        max-width: 100%;
        min-width: 0;
    }

    .waveform-container#waveformContainer .session-info-panel {
        width: 100%;
        max-width: 100%;
    }

    .waveform-container#waveformContainer .session-bpm-tab {
        width: 100%;
        max-width: 100%;
    }

    .waveform-container#waveformContainer::before {
        inset: 4px;
        border-radius: 19px;
    }

    .waveform-container#waveformContainer::after {
        border-radius: 24px;
        opacity: 0.28;
    }

    .waveform-container#waveformContainer .canvas-wrapper {
        height: 230px;
    }

    .waveform-container#waveformContainer .endpoint-input {
        font-size: 24px;
        width: 84px;
    }

    .waveform-container#waveformContainer .endpoint-input.bpm-display {
        font-size: 24px;
    }

    .waveform-container#waveformContainer .endpoint-unit {
        font-size: 11px;
    }

    .waveform-container#waveformContainer .canvas-wrapper::before,
    .waveform-container#waveformContainer .canvas-wrapper::after {
        top: 24px;
        bottom: 24px;
        opacity: 0.58;
    }
}

@media (max-width: 768px) {
    body {
        padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
    }

    .control-tabs {
        padding: 0 2px;
    }

    .waveform-container#waveformContainer {
        width: 100%;
        max-width: none;
        border-radius: 16px;
        padding: 10px 10px 8px;
        margin-left: auto;
        margin-right: auto;
    }

    .waveform-container#waveformContainer::before {
        inset: 3px;
        border-radius: 12px;
    }

    .waveform-container#waveformContainer::after {
        border-radius: 16px;
        opacity: 0.2;
    }

    .waveform-container#waveformContainer .waveform-top-layout {
        padding: 8px;
        gap: 8px;
    }

    .waveform-container#waveformContainer .endpoint-control {
        min-width: 118px;
        padding: 7px;
    }

    .waveform-container#waveformContainer .endpoint-input,
    .waveform-container#waveformContainer .endpoint-input.bpm-display {
        font-size: 21px;
        width: 78px;
        padding: 6px 6px;
    }

    .waveform-container#waveformContainer .endpoint-unit {
        font-size: 10px;
    }

    .waveform-container#waveformContainer .session-info-panel {
        width: 100%;
        min-width: 0;
    }

    .session-bpm-tab {
        padding: 7px 8px 6px;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
    }

    .session-bpm-controls .endpoint-input.bpm-display {
        width: 110px;
        min-width: 110px;
        font-size: 21px;
        padding: 5px 8px;
    }

    .session-bpm-buttons .bpm-btn {
        width: 28px;
        height: 20px;
        font-size: 13px;
    }

    .waveform-container#waveformContainer .canvas-wrapper {
        height: 185px;
    }

    .waveform-container#waveformContainer .canvas-wrapper::before,
    .waveform-container#waveformContainer .canvas-wrapper::after {
        width: 2px;
        top: 18px;
        bottom: 18px;
        opacity: 0.45;
    }

    .waveform-container#waveformContainer .canvas-wrapper::before {
        left: 8px;
    }

    .waveform-container#waveformContainer .canvas-wrapper::after {
        right: 8px;
    }
}

@media (max-width: 430px) {
    .control-tabs {
        padding: 0 1px;
    }

    .waveform-container#waveformContainer {
        width: 100%;
        padding: 9px 6px 8px;
    }
}

/* ====================================
   Portrait Mobile 3-Zone Layout
   Status -> Wave -> Sticky Action Rail
   ==================================== */
@media (max-width: 768px) and (orientation: portrait) {
    /* Keep chassis clear of fixed action rail */
    .waveform-container#waveformContainer {
        margin-bottom: calc(110px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Top status strip stays compact */
    .waveform-container#waveformContainer .waveform-top-layout {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .waveform-container#waveformContainer .waveform-top-layout .marketing-section {
        order: 1;
    }

    .waveform-container#waveformContainer .waveform-top-layout .waveform-info {
        order: 2;
    }

    .waveform-container#waveformContainer .controls-row {
        justify-content: center;
        align-items: center;
        margin-left: auto;
        margin-right: auto;
    }

    .waveform-container#waveformContainer .session-info-panel {
        order: 2;
        width: 100%;
        padding: 10px 12px;
    }

    .waveform-container#waveformContainer .session-info-panel .view-indicator,
    .waveform-container#waveformContainer .session-info-panel .position-info {
        font-size: 13px;
    }

    /* Controls switcher: closed => one button, open => focused mode panel */
    .nav-bar {
        display: block !important;
        align-items: stretch;
        gap: 0;
        padding: 6px;
        overflow: hidden;
    }

    .nav-bar .mobile-controls-switcher {
        display: block;
        margin-bottom: 6px;
    }

    .nav-bar .mobile-controls-modes {
        display: flex;
        gap: 6px;
        align-items: center;
    }

    .nav-bar .mobile-mode-btn {
        flex: 1 1 0;
        min-height: 36px;
        padding: 0 10px;
        border-radius: 8px;
        border: 1px solid #4c545b;
        background: #1e242a;
        color: #d0d7da;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        cursor: pointer;
    }

    .nav-bar .mobile-mode-btn.active {
        border-color: rgba(63, 227, 220, 0.8);
        color: #3fe3dc;
        background: rgba(63, 227, 220, 0.12);
    }

    .nav-bar .nudge-controls,
    .nav-bar .position-controls,
    .nav-bar .wave-nav-buttons {
        display: none !important;
    }

    .nav-bar.mobile-mode-nudge .nudge-controls {
        display: flex !important;
        margin-top: 4px !important;
        justify-content: center !important;
    }

    .nav-bar.mobile-mode-nudge .position-controls {
        display: flex !important;
        justify-content: center;
        margin-top: 4px;
    }

    .nav-bar.mobile-mode-nudge .position-controls .bar-section {
        display: none !important;
    }

    .nav-bar.mobile-mode-bar .position-controls {
        display: flex !important;
        justify-content: flex-start;
        margin-top: 4px;
        width: 100%;
        min-width: 0;
    }

    .nav-bar.mobile-mode-bar .position-controls .snap-section,
    .nav-bar.mobile-mode-bar .nudge-controls {
        display: none !important;
    }

    .nav-bar.mobile-mode-bar .position-controls .bar-section {
        width: 100%;
        min-width: 0;
    }

    .nav-bar .bar-section-header {
        width: 100%;
        justify-content: center;
        gap: 6px;
    }

    .nav-bar .position-controls .bar-buttons,
    .nav-bar .position-controls .snap-section .bar-buttons {
        display: flex;
        flex-wrap: nowrap;
        gap: 3px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 0 2px 2px;
    }

    .nav-bar .position-controls .bar-buttons::-webkit-scrollbar,
    .nav-bar .position-controls .snap-section .bar-buttons::-webkit-scrollbar {
        display: none;
    }

    .nav-bar .btn-nudge {
        min-width: 36px !important;
        width: 36px !important;
        height: 36px !important;
    }

    .nav-bar .nudge-controls .nudge-buttons {
        display: flex;
        flex-direction: row !important;
        align-items: center;
        gap: 8px;
    }

    .nav-bar .nudge-label {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 52px;
        font-size: 10px !important;
        letter-spacing: 0.06em;
    }

    .nav-bar .position-controls .btn-snap,
    .nav-bar .position-controls .btn-bar {
        min-width: 34px !important;
        height: 34px !important;
        padding: 0 6px !important;
        font-size: 10px;
        scroll-snap-align: start;
    }

    /* Manual uses checkbox in title row in portrait; hide M button to save width */
    .nav-bar .position-controls #bar-manual {
        display: none !important;
    }

    .nav-bar .position-controls .section-label,
    .nav-bar .nudge-label {
        font-size: 9px !important;
    }

    /* Keep zoom toggle available on mobile, hide left/right wave arrows */
    .nav-bar .wave-nav-buttons {
        display: flex !important;
        justify-content: center;
        width: 100%;
        margin-top: 6px !important;
    }

    .nav-bar .wave-nav-buttons .wave-nav-label,
    .nav-bar .wave-nav-buttons #waveNavLeft,
    .nav-bar .wave-nav-buttons #waveNavRight {
        display: none !important;
    }

    .nav-bar .wave-nav-buttons .btn-wave-zoom {
        min-width: 120px;
        height: 34px;
        font-size: 10px;
        padding: 0 12px;
    }

    /* Sticky action rail */
    .chop-list {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 120;
        max-height: 72vh;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(180deg, rgba(16, 20, 24, 0.94) 0%, rgba(10, 12, 15, 0.98) 100%);
        border-top: 1px solid rgba(63, 227, 220, 0.45);
        box-shadow: 0 -6px 14px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(8px);
        overflow: visible;
    }

    .chop-header {
        position: sticky;
        top: 0;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 6px 8px;
        align-items: center;
        margin-bottom: 6px;
        padding: 4px 2px 6px;
        background: transparent;
        position: relative;
    }

    .chop-title-row {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-top: 2px;
        padding: 6px 0 2px;
        border-radius: 0;
    }

    .chop-buttons-stack {
        display: flex;
        flex-direction: row;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        white-space: nowrap;
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
        min-width: 0;
    }

    .chop-title {
        font-size: 14px !important;
        white-space: nowrap;
        justify-self: start;
        text-align: left;
        margin: 0 !important;
    }

    .chop-select-all-btn {
        font-size: 10px;
        padding: 3px 7px;
    }

    .chop-buttons-stack::-webkit-scrollbar {
        display: none;
    }

    /* Primary rail actions only */
    .chop-header .chop-buttons-stack #exportBtn,
    .chop-header .chop-buttons-stack #uploadNewBtn {
        display: none !important;
    }

    .chop-header .chop-buttons-stack #playStopBtn,
    .chop-header .chop-buttons-stack #clearAllBtn,
    .chop-header .chop-buttons-stack #mobileMoreBtn {
        min-width: 68px !important;
        width: 68px !important;
        max-width: 68px !important;
        height: 38px !important;
        min-height: 38px !important;
        padding: 0 6px !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        border-radius: 8px !important;
    }

    .chop-header .chop-buttons-stack #centerChopBtn {
        min-width: 110px !important;
        width: 110px !important;
        max-width: 110px !important;
        height: 38px !important;
        min-height: 38px !important;
        padding: 0 8px !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        border-radius: 8px !important;
    }

    .chop-header .chop-buttons-stack #mobileMoreBtn {
        display: inline-flex !important;
        border-color: #fff !important;
        color: #fff !important;
    }

    .chop-header .chop-buttons-stack .loop-switch-container {
        display: inline-flex !important;
        align-items: center;
        gap: 4px;
        padding: 0 2px !important;
        margin: 0 !important;
        border: none !important;
        background: transparent !important;
    }

    .chop-header .chop-buttons-stack .loop-switch-label {
        font-size: 9px;
        margin: 0;
    }

    .chop-header .chop-buttons-stack .loop-switch-track {
        width: 44px;
        height: 22px;
        border-width: 1px;
    }

    .chop-header .chop-buttons-stack .loop-switch-thumb {
        width: 16px;
        height: 16px;
        top: 2px;
        left: 2px;
    }

    .chop-header .chop-buttons-stack .loop-switch-thumb.active {
        left: 25px;
    }

    .mobile-more-menu {
        display: none;
        position: absolute;
        right: 2px;
        bottom: calc(100% + 8px);
        min-width: 130px;
        border: 1px solid rgba(63, 227, 220, 0.45);
        border-radius: 10px;
        background: linear-gradient(180deg, #20262b 0%, #171c21 100%);
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.42);
        padding: 6px;
        z-index: 200;
    }

    .mobile-more-menu.is-open {
        display: grid;
        gap: 6px;
    }

    .mobile-more-item {
        width: 100%;
        min-height: 34px;
        border: 1px solid #4f565c;
        border-radius: 8px;
        background: #1e2429;
        color: #e5eaec;
        font-size: 12px;
        font-weight: 700;
        text-align: left;
        padding: 0 10px;
        cursor: pointer;
    }

    .mobile-more-item:hover {
        background: #263038;
        border-color: #66d9d3;
    }

    .mobile-more-item.mobile-more-danger {
        border-color: #b75656;
        color: #ff9a9a;
    }

    .chop-toggle {
        width: 30px;
        height: 30px;
        border-radius: 6px;
        font-size: 28px;
        margin-right: 10px;
    }

    .chop-container {
        max-height: 54vh;
        overflow: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .chop-container.collapsed {
        max-height: 0;
        overflow: hidden;
    }

    .chop-items {
        grid-template-columns: repeat(4, minmax(64px, 1fr));
        gap: 8px;
       
    }
}

/* iPad mini portrait (768x1024): keep compact flow, but center key rows */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .nav-bar.mobile-mode-bar .position-controls .bar-section {
        align-items: center;
    }

    .nav-bar.mobile-mode-bar .position-controls .bar-buttons {
        width: auto;
        max-width: 100%;
        margin: 0 auto;
        justify-content: center;
        overflow-x: visible;
    }

    .waveform-container#waveformContainer .session-info-panel {
        width: min(560px, 100%);
        margin-left: auto;
        margin-right: auto;
    }

    .chop-buttons-stack {
        width: fit-content;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
        overflow-x: visible;
    }
}

/* Final non-phone nav spacing override (must come after tablet rules) */
@media (min-width: 769px) {
    .nav-bar .position-controls {
        display: flex !important;
        gap: 50px !important;
        margin: 0 14px;
    }

    .nav-bar .nudge-controls {
        margin-right: 14px !important;
    }

    .nav-bar .wave-nav-buttons {
        margin-left: 14px !important;
    }
}

/* Featured packs + sample list view switcher */
.featured-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.featured-view-toggle {
    display: inline-flex;
    gap: 6px;
    margin-left: auto;
}

.featured-view-btn {
    border: 1px solid #4c545b;
    background: #1e242a;
    color: #d0d7da;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 8px;
    min-height: 30px;
    padding: 0 10px;
    cursor: pointer;
}

.featured-view-btn.active {
    border-color: rgba(63, 227, 220, 0.8);
    color: #3fe3dc;
    background: rgba(63, 227, 220, 0.12);
}

#freeSoundBtn {
    border: 1px solid #dadada;
    color: #dadada;
    background: transparent;
}

#freeSoundBtn:hover {
    background: transparent;
    border-color: #4ecdc4;
    color: #4ecdc4;
}


.featured-view-panel[hidden] {
    display: none !important;
}

.featured-view-panel {
    min-height: 0;
    overflow: hidden;
}

.marketing-section,
.featured-pack {
    min-height: 0;
}

#sampleListView {
    height: min(320px, 36vh);
    max-height: 36vh;
}

.sample-list {
    display: grid;
    gap: 8px;
    height: 100%;
    max-height: 100%;
    align-content: start;
    grid-auto-rows: max-content;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding-right: 2px;
    padding-bottom: 4px;
}

.freesound-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr) minmax(76px, 0.6fr) auto;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(77, 92, 102, 0.8);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(18, 24, 30, 0.92), rgba(12, 17, 22, 0.92));
    box-shadow: inset 0 1px 0 rgba(120, 142, 156, 0.15);
}

.freesound-filter-input {
    min-width: 0;
}

.freesound-toolbar .sample-list-search-input {
    height: 40px;
    border: 1px solid #3d4c56;
    border-radius: 8px;
    background: #0e141a;
    color: #e2ebef;
    font-size: 11px;
    letter-spacing: 0.01em;
    padding: 0 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.freesound-toolbar .sample-list-search-input::placeholder {
    color: #7e919c;
}

.freesound-toolbar input[type="number"]::-webkit-outer-spin-button,
.freesound-toolbar input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.freesound-toolbar input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.freesound-toolbar .sample-list-search-input:focus {
    outline: none;
    border-color: rgba(78, 205, 196, 0.9);
    box-shadow: 0 0 0 2px rgba(78, 205, 196, 0.2);
    background: #111a21;
}

.freesound-toolbar .sample-list-search-btn {
    height: 40px;
    min-width: 84px;
    border: 1px solid #dadada;
    border-radius: 8px;
    background: transparent;
    color: #dadada;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 245, 180, 0.2);
    cursor: pointer;
    transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}

.freesound-toolbar .sample-list-search-btn:hover {
    background: transparent;
    border-color: #4ecdc4;
    color: #4ecdc4;
}

@media (max-width: 1024px) {
    .featured-header {
        align-items: center;
        row-gap: 8px;
    }

    .featured-title {
        flex: 1 1 100%;
        margin-right: 0;
    }

    .featured-view-toggle {
        margin-left: 0;
        flex: 1 1 auto;
    }

    #freeSoundBtn {
        flex: 0 0 auto;
        min-height: 32px;
        padding: 0 12px;
    }

    #sampleListView {
        height: min(280px, 32vh);
        max-height: 32vh;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    #sampleListView {
        height: min(210px, 26vh);
        max-height: 26vh;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .featured-pack {
        height: 292px;
    }

    .featured-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px 8px;
        margin-bottom: 4px;
    }

    .featured-header .featured-title {
        grid-column: 1;
        grid-row: 1;
        margin: 2px 0 0;
        min-width: 0;
        line-height: 1.1;
    }

    .featured-view-toggle {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-left: 0;
        margin-top: 2px;
        width: 100%;
        min-width: 0;
    }

    .featured-view-toggle .featured-view-btn {
        flex: 1 1 0;
        min-width: 0;
        text-align: center;
        min-height: 30px;
        padding: 0 6px;
        font-size: 9px;
        letter-spacing: 0.02em;
        line-height: 1;
        white-space: nowrap;
    }

    #freeSoundBtn {
        min-height: 30px;
        font-size: 9px;
        letter-spacing: 0.02em;
    }

    .featured-mobile-toggle {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        margin-left: 0;
        align-self: center;
    }

    #sampleListView {
        height: min(250px, 30vh);
        max-height: 30vh;
    }

    .pack-slider-shell {
        margin-top: 10px;
    }
}

@media (max-width: 860px) {
    .freesound-toolbar {
        grid-template-columns: 78px 78px 200px;
        grid-template-areas:
            "keyword keyword keyword"
            "key bpm search";
        padding: 7px;
        column-gap: 5px;
        row-gap: 8px;
    }

    #freesoundSearchInput {
        grid-area: keyword;
        min-width: 0;
    }

    #freesoundSearchBtn {
        grid-area: search;
        align-self: stretch;
    }

    #freesoundKeyInput {
        grid-area: key;
        min-width: 0;
    }

    #freesoundBpmInput {
        grid-area: bpm;
        min-width: 0;
    }

    #freesoundSearchBtn {
        grid-area: search;
    }

    .freesound-toolbar .sample-list-search-btn {
        width: 200px;
        min-width: 200px;
        justify-self: end;
        height: 40px;
        font-size: 11px;
        padding: 0 10px;
    }

    .freesound-toolbar .sample-list-search-input {
        height: 40px;
        font-size: 12px;
    }

    #freesoundSearchInput {
        height: 44px;
    }
}

@media (max-width: 430px) {
    .featured-view-toggle .featured-view-btn,
    #freeSoundBtn {
        font-size: 8px;
        letter-spacing: 0.01em;
        padding: 0 4px;
        white-space: nowrap;
    }

    .freesound-toolbar {
        grid-template-columns: minmax(0, 1fr) 64px minmax(108px, 1fr);
        grid-template-areas:
            "keyword keyword keyword"
            "key bpm search";
        column-gap: 4px;
        row-gap: 9px;
        padding: 6px;
        overflow: hidden;
    }

    .freesound-toolbar .sample-list-search-input {
        height: 42px;
        padding: 0 8px;
        font-size: 11px;
        min-width: 0;
    }

    #freesoundSearchInput {
        height: 46px;
        width: 100%;
        min-width: 0;
    }

    .freesound-toolbar .sample-list-search-btn {
        width: 100%;
        min-width: 0;
        max-width: 200px;
        justify-self: stretch;
        height: 42px;
        font-size: 10px;
        letter-spacing: 0.04em;
        padding: 0 10px;
    }
}

.freesound-modal {
    max-width: 820px;
    width: min(92vw, 820px);
}

.freesound-modal .modal-body {
    margin-bottom: 12px;
}

.freesound-modal-title {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    gap: 2px;
}

.freesound-powered-by {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #90a0aa;
}

.freesound-modal .modal-close-x {
    color: #fff;
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
}

.freesound-modal .modal-close-x i[data-lucide] {
    width: 18px;
    height: 18px;
}

.freesound-modal #freesoundStatus {
    margin: 6px 2px 8px;
    font-size: 11px;
    font-style: italic;
    line-height: 1.35;
    color: #8f9ba3;
}

.freesound-modal #freesoundStatus.is-error {
    color: #cc7e7e;
}

.freesound-modal .freesound-list {
    height: min(420px, 58vh);
    max-height: 58vh;
}

.freesound-load-more-btn {
    display: block;
    width: min(340px, 100%);
    margin: 8px auto 12px;
    height: 40px;
    border: 1px solid #dadada;
    border-radius: 8px;
    background: transparent;
    color: #dadada;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 245, 180, 0.2);
    cursor: pointer;
    transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease, opacity 0.16s ease;
}

.freesound-load-more-btn:hover {
    background: transparent;
    border-color: #4ecdc4;
    color: #4ecdc4;
}

.freesound-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 860px) {
    .freesound-modal {
        width: 96vw;
    }

    .freesound-modal .modal-header {
        margin-bottom: 10px;
        padding-right: 2px;
    }

    .freesound-modal .modal-close-x {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        padding: 1px;
        margin-left: 6px;
        align-self: center;
        line-height: 1;
        font-size: 18px;
        overflow: visible;
    }

    .freesound-modal .modal-close-x i[data-lucide] {
        width: 16px;
        height: 16px;
    }

    .freesound-modal .freesound-list {
        height: min(52vh, 360px);
        max-height: 52vh;
    }

    .freesound-load-more-btn {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        height: 42px;
        font-size: 10px;
    }
}

@media (max-width: 430px) {
    .freesound-load-more-btn {
        height: 44px;
        font-size: 10px;
    }
}

@media (max-width: 430px) {
    .freesound-modal .modal-header {
        margin-bottom: 8px;
    }

    .freesound-modal .modal-close-x {
        width: 26px;
        height: 26px;
        min-width: 26px;
        min-height: 26px;
        margin-left: 4px;
    }

    .freesound-modal .modal-close-x i[data-lucide] {
        width: 15px;
        height: 15px;
    }
}

.sample-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #374047;
    border-radius: 10px;
    background: rgba(15, 20, 25, 0.6);
    padding: 8px 10px;
}

.sample-list-meta {
    flex: 1 1 auto;
    min-width: 0;
}

.sample-list-title {
    margin: 0;
    font-size: 13px;
    color: #e6ecef;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.sample-list-subtitle {
    margin: 2px 0 0 0;
    font-size: 11px;
    color: #98a7b0;
    text-align: left;
}

.sample-list-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.sample-list-duration {
    font-size: 11px;
    color: #aab6be;
    min-width: 38px;
    text-align: right;
}

.sample-list-play-btn,
.sample-list-load-btn {
    width: 78px;
    min-width: 78px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #4ecdc4;
    border-radius: 8px;
    background: transparent;
    color: #c7f1ee;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    flex: 0 0 78px;
}

.sample-list-play-btn.is-playing {
    border-color: #f2de53;
    color: #f2de53;
}

@media (max-width: 768px) {
    .sample-list-item {
        gap: 4px;
        padding: 6px 7px;
    }

    .sample-list-meta {
        flex: 1 1 auto;
        min-width: 0;
    }

    .sample-list-actions {
        gap: 3px;
        margin-left: 5px;
    }

    .sample-list-duration {
        min-width: 30px;
        font-size: 10px;
    }

    .sample-list-play-btn,
    .sample-list-load-btn {
        width: 88px;
        min-width: 88px;
        height: 36px;
        padding: 0 8px;
        font-size: 10px;
        letter-spacing: 0.03em;
        flex: 0 0 88px;
    }
}

.sample-list-empty {
    border: 1px dashed #4a535a;
    border-radius: 10px;
    color: #adb9c0;
    font-size: 12px;
    text-align: center;
    padding: 14px 10px;
}

/* Keep zoom toggle visible while hiding left/right wave arrows */
.nav-bar .wave-nav-buttons #waveNavLeft,
.nav-bar .wave-nav-buttons #waveNavRight {
    display: none !important;
}

/* Dev-only utility: hide cache legend in customer-facing builds.
   Remove `is-hidden` from the legend element in index.html to show it again. */
.pack-cache-legend.is-hidden {
    display: none !important;
}
