@charset "UTF-8";
/* Modern Glassmorphism Audio Editor CSS */

/* ====== NỀN & BODY ====== */
body {
    background: linear-gradient(120deg, #f3f6ff 0%, #e3ebff 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #2a3554;
    letter-spacing: 0;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    z-index: 0;
    inset: 0;
    background: url('../img/bg-blur.jpg') center/cover no-repeat;
    opacity: 0.13;           /* Độ mờ hình nền (0.1 - 0.3 là đẹp) */
    filter: blur(12px);      /* Độ blur, chỉnh cao/thấp tùy ý */
    pointer-events: none;    /* Không ảnh hưởng thao tác */
    transition: opacity 0.4s;
}
.selected-region {
    border: 2px solid #f25252 !important;
    box-shadow: 0 0 0 2px #ffd6d6;
}

/* ====== HEADER ====== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 70px;
    background:
        linear-gradient(90deg, rgba(29, 34, 47, 0.98) 0%, rgba(52, 59, 87, 0.98) 58%, rgba(84, 75, 130, 0.98) 100%) !important;
    box-shadow: 0 8px 28px #1b20301f;
    border-bottom: 1px solid #ffffff1c;
}
.brand-lockup img {
    height: 42px;
    width: 42px;
    object-fit: contain;
    box-shadow: 0 8px 24px #0b102433;
    border-radius: 8px;
}
.brand-title {
    font-size: 1.34rem;
    font-weight: 800;
    letter-spacing: 0;
    color: #f7faff;
    white-space: nowrap;
}
.app-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.app-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 700;
    opacity: 0.94;
    transition: background .16s, color .16s, transform .16s;
    text-decoration: none;
}
.app-nav a:hover {
    background: rgba(255,255,255,0.12);
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* ====== TABS ====== */
.nav-tabs {
    background: rgba(255,255,255,0.82);
    border-radius: 8px;
    padding: 7px;
    box-shadow: 0 8px 28px #9fb4d21f;
    border: none;
    gap: 6px;
}
.nav-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.02rem;
    padding: 10px 24px;
    border-radius: 8px !important;
    background: none;
    border: none;
    color: #3e4a77;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
    margin-right: 0;
    font-weight: 750;
}
.nav-tabs .nav-link.active, .nav-tabs .nav-link:focus {
    background: linear-gradient(120deg, #ecf3ff 0%, #ffffff 100%);
    color: #6b44d8 !important;
    border: none;
    box-shadow: 0 8px 18px #6880bd26;
    transform: translateY(-1px);
}
.tab-pane.fade {
    transform: translateY(8px);
    transition: opacity .22s ease, transform .22s ease;
}
.tab-pane.fade.show {
    transform: translateY(0);
}

/* ====== FORM VÀ INPUT ====== */
.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #e2e9f5;
    font-size: 1.01rem;
    background: rgba(251,253,255,0.94);
    box-shadow: 0 2px 8px #c6d9fa12;
    transition: border-color .16s, box-shadow .16s;
}
.form-control:focus, .form-select:focus {
    border-color: #7a3df0;
    box-shadow: 0 0 6px #aab5e9;
}

/* ====== TRACKS VÀ TIMELINE ====== */
:root {
    --track-header-width: 188px;
}
#timeline {
    position: relative;
    min-height: 300px;
    background: #15181f !important;
    border-color: #2a3240 !important;
    color: #dce6f7;
    box-shadow: inset 0 1px 0 #ffffff12, inset 0 -1px 0 #0006;
}
.mix-session-toolbar,
.mix-edit-toolbar {
    position: sticky;
    left: 0;
    z-index: 20;
    width: max-content;
    max-width: calc(100vw - 32px);
    background: #eef3ff;
    color: #25304b;
    border: 1px solid #cfd9ef;
    border-radius: 8px;
    padding: 8px 10px;
    box-shadow: 0 8px 22px #00000020;
}
.mix-edit-toolbar {
    background: #f7f9ff;
}
.mix-session-ruler {
    display: grid;
    grid-template-columns: var(--track-header-width) max-content;
    min-height: 34px;
    margin-bottom: 6px;
    border: 1px solid #2d3441;
    border-radius: 6px;
    overflow: visible;
    background: #11141a;
}
.mix-ruler-left {
    position: sticky;
    left: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #20242d;
    border-right: 1px solid #343b48;
    color: #aeb9ca;
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
}
.mix-ruler-grid {
    position: relative;
    min-height: 34px;
    background:
        repeating-linear-gradient(90deg, #ffffff20 0 1px, transparent 1px 80px),
        linear-gradient(180deg, #181c24 0%, #11141a 100%);
}
.ruler-tick {
    position: absolute;
    top: 8px;
    transform: translateX(-1px);
    color: #aeb9ca;
    font-size: 0.78rem;
    line-height: 1;
    padding-left: 5px;
    border-left: 1px solid #6d7684;
    white-space: nowrap;
}
.track-timeline {
    position: relative;
    display: grid;
    grid-template-columns: var(--track-header-width) max-content;
    margin-bottom: 6px;
    background: #171b22;
    border-radius: 6px;
    border: 1px solid #303846;
    min-height: 64px;
    padding: 0;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
    overflow: visible;
}
.track-timeline:hover {
    border-color: color-mix(in srgb, var(--track-accent, #34c486) 55%, #3b4453);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--track-accent, #34c486) 32%, transparent);
}
.track-controls {
    position: sticky;
    left: 0;
    z-index: 14;
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: var(--track-header-width);
    min-width: var(--track-header-width);
    padding: 10px 10px 9px;
    background: linear-gradient(180deg, #242933 0%, #1d222b 100%);
    border-right: 1px solid #384150;
    color: #e7eefc;
    font-size: 0.86rem;
}
.track-title-row {
    display: grid;
    gap: 2px;
}
.track-number {
    color: var(--track-accent, #34c486);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.15;
}
.track-file-name {
    color: #cbd5e5;
    font-size: 0.78rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.track-button-row {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.track-slider-row {
    display: grid;
    grid-template-columns: 1fr 72px;
    gap: 6px;
    align-items: center;
    color: #b7c1d2;
}
.track-slider-row b {
    color: #ffffff;
    font-weight: 700;
}
.track-slider-row input[type="range"] {
    width: 72px;
    accent-color: var(--track-accent, #34c486);
}
.track-controls .btn {
    background: #262d38;
    color: #dce6f7;
    border-color: #606b7a;
}
.track-controls .btn:hover,
.track-controls .btn:focus {
    background: #323b49;
    color: #ffffff;
    border-color: var(--track-accent, #34c486);
}
.track-lane {
    position: relative;
    overflow-x: visible;
    min-height: 100%;
    padding: 8px 0;
    background:
        repeating-linear-gradient(90deg, #ffffff16 0 1px, transparent 1px 80px),
        repeating-linear-gradient(90deg, transparent 0 399px, #ffffff24 399px 400px),
        linear-gradient(180deg, #20252e 0%, #191d24 100%);
}
.track-lane::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, #00000030, transparent 36px);
}
.track-clip {
    position: relative;
    min-width: 260px;
    border: 1px solid color-mix(in srgb, var(--track-accent, #34c486) 72%, #ffffff);
    border-radius: 5px;
    background: var(--track-clip-bg, rgba(17, 106, 74, 0.92));
    box-shadow: inset 0 1px 0 #ffffff20, 0 6px 14px #00000030;
    transition: box-shadow .15s, transform .15s;
    overflow: hidden;
}
.track-clip.is-dragging {
    box-shadow: 0 0 0 2px #fff2, 0 12px 24px #00000055;
}
.track-clip.mix-selected-clip::after,
.single-cutter-clip.mix-selected-clip::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 24px;
    bottom: 24px;
    z-index: 4;
    background: linear-gradient(90deg, rgba(52, 196, 134, 0.22), rgba(52, 196, 134, 0.12));
    box-shadow: inset 0 0 0 2px rgba(52, 196, 134, 0.55);
    pointer-events: none;
}
.clip-titlebar {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 24px;
    padding: 0 9px;
    background: linear-gradient(180deg, #ffffff20 0%, #00000016 100%);
    color: #f8fbff;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.clip-titlebar span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.track-waveform {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: 54px;
    cursor: crosshair;
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
    margin-bottom: 0;
    transition: border-color .15s;
}
.volume-automation {
    position: absolute;
    left: 0;
    right: 0;
    top: 24px;
    z-index: 8;
    pointer-events: none;
}
.volume-automation svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}
.automation-line-shadow,
.automation-line,
.automation-line-hit {
    fill: none;
    vector-effect: non-scaling-stroke;
}
.automation-line-shadow {
    stroke: rgba(0,0,0,0.55);
    stroke-width: 5;
}
.automation-line {
    stroke: #fff3a8;
    stroke-width: 2.4;
    filter: drop-shadow(0 0 5px rgba(255, 219, 97, 0.45));
}
.automation-line-hit {
    stroke: transparent;
    stroke-width: 16;
    pointer-events: stroke;
    cursor: copy;
}
.automation-node {
    fill: #fff7b8;
    stroke: #222734;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    pointer-events: all;
    cursor: ns-resize;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.45));
}
.automation-node:hover {
    fill: #ffffff;
    stroke: #ffd15f;
}
.dragging-automation,
.dragging-automation * {
    cursor: ns-resize !important;
    user-select: none;
}
.wavesurfer-timeline {
    background: rgba(6, 10, 16, 0.3);
}
.clip-drag-handle,
.clip-titlebar {
    cursor: grab;
}
.dragging-track,
.dragging-track * {
    cursor: grabbing !important;
    user-select: none;
}
.track-waveform:active, .track-waveform:focus {
    outline: 1px solid var(--track-accent, #34c486);
}
.track-muted {
    opacity: 0.55;
    filter: grayscale(0.65) brightness(0.88);
}
.segment-selected, .wavesurfer-region {
    background: rgba(79, 166, 255, 0.18) !important;
    border: 2px dashed #4fa6ff !important;
    transition: background .18s, border-color .18s, box-shadow .18s;
}
.wavesurfer-region.selected-all-region {
    background: rgba(52, 196, 134, 0.48) !important;
    border: 2px solid #34c486 !important;
    box-shadow: inset 0 0 0 999px rgba(52, 196, 134, 0.16), inset 0 0 0 2px #d3ffe660, 0 0 18px #34c48670;
    z-index: 7 !important;
}
.wavesurfer-region.selected-region {
    border: 2px solid #ffd15f !important;
    box-shadow: inset 0 0 0 2px #fff6c850, 0 0 14px #ffd15f66;
}
.wavesurfer-region[data-label]::after {
    content: attr(data-label);
    display: inline-block;
    position: absolute;
    top: -26px;
    left: 10px;
    background: #20242d;
    color: #fff;
    padding: 1px 10px;
    border-radius: 6px;
    font-size: 0.85em;
    opacity: 0.92;
    pointer-events: none;
}

/* ====== SINGLE FILE CUTTER ====== */
:root {
    --cutter-header-width: 188px;
}
.single-cutter-shell {
    display: grid;
    gap: 10px;
}
.single-cutter-topbar,
.single-cutter-toolbar,
.single-cutter-editbar,
.cutter-exportbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(248,251,255,0.96);
    border: 1px solid #dbe5f4;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 8px 22px #9fb4d21f;
}
.single-cutter-topbar {
    justify-content: space-between;
}
.single-cutter-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.single-cutter-title > i {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #e6fff4;
    background: linear-gradient(135deg, #1f9f72 0%, #5967d8 100%);
    box-shadow: 0 8px 18px #255f7430;
}
.single-cutter-title h5 {
    color: #24304c;
    font-weight: 850;
}
.cutter-file-name {
    display: block;
    max-width: min(58vw, 820px);
    color: #64748b;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.single-cutter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cutter-file-picker {
    background: #252b35;
    color: #e9f0fb;
    border-color: #657286;
}
.single-cutter-toolbar,
.single-cutter-editbar {
    background: #eef3ff;
}
.single-cutter-editbar {
    background: #f8fbff;
}
.tool-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    color: #25304b;
}
.tool-control span {
    font-size: 0.92rem;
    color: #40506d;
    font-weight: 650;
}
.tool-control b {
    min-width: 52px;
    color: #24304c;
    font-weight: 750;
}
.single-cutter-selected {
    color: #667085;
    font-weight: 650;
    min-width: 112px;
}
.single-cutter-editor {
    position: relative;
    overflow: auto;
    min-height: 262px;
    background: #15181f;
    border: 1px solid #2a3240;
    border-top: 8px solid #15181f;
    border-radius: 8px;
    color: #dce6f7;
    box-shadow: inset 0 1px 0 #ffffff12, inset 0 -1px 0 #0006;
}
.single-cutter-editor.is-file-dragover {
    border-color: #7fe3ad;
    box-shadow: inset 0 1px 0 #ffffff12, inset 0 -1px 0 #0006, 0 0 0 3px #7fe3ad4d;
}
.single-cutter-editor.is-file-dragover::after {
    content: "Thả file audio vào timeline";
    position: absolute;
    inset: 8px;
    z-index: 35;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #a8f5c9;
    border-radius: 8px;
    background: rgba(12, 18, 28, 0.72);
    color: #e9fff3;
    font-weight: 800;
    pointer-events: none;
}
.single-cutter-lane.is-file-dragover,
.single-cutter-clip.is-file-dragover {
    outline: 2px solid #7fe3ad;
    outline-offset: -2px;
}
.single-cutter-ruler {
    display: grid;
    grid-template-columns: var(--cutter-header-width) max-content;
    min-height: 36px;
    border-bottom: 1px solid #2e3644;
    background: #11141a;
}
.single-cutter-ruler-left {
    position: sticky;
    left: 0;
    z-index: 18;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #20242d;
    border-right: 1px solid #343b48;
    color: #aeb9ca;
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
}
.single-cutter-ruler-grid {
    position: relative;
    min-height: 36px;
    background:
        repeating-linear-gradient(90deg, #ffffff20 0 1px, transparent 1px 80px),
        linear-gradient(180deg, #181c24 0%, #11141a 100%);
}
.single-cutter-track {
    display: grid;
    grid-template-columns: var(--cutter-header-width) max-content;
    min-height: 188px;
    border-bottom: 1px solid #2e3644;
}
.single-cutter-track-head {
    position: sticky;
    left: 0;
    z-index: 18;
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: var(--cutter-header-width);
    min-width: var(--cutter-header-width);
    padding: 12px 10px;
    background: linear-gradient(180deg, #242933 0%, #1d222b 100%);
    border-right: 1px solid #384150;
    color: #e7eefc;
}
.single-cutter-track-head .track-file-name {
    max-width: 150px;
}
.single-cutter-lane {
    position: relative;
    min-width: 640px;
    padding: 12px 12px 34px 0;
    background:
        repeating-linear-gradient(90deg, #ffffff16 0 1px, transparent 1px 80px),
        repeating-linear-gradient(90deg, transparent 0 399px, #ffffff24 399px 400px),
        linear-gradient(180deg, #20252e 0%, #191d24 100%);
}
.single-cutter-clip {
    position: relative;
    min-width: 640px;
    border: 1px solid #7fe3ad;
    border-radius: 5px;
    background: rgba(17, 106, 74, 0.92);
    box-shadow: inset 0 1px 0 #ffffff20, 0 6px 14px #00000030;
    overflow: hidden;
}
.single-cutter-waveform {
    width: 100%;
    min-height: 70px;
    cursor: crosshair;
    background: transparent;
}
.single-cutter-waveform wave,
.single-cutter-waveform canvas {
    background: transparent !important;
}
.cutter-volume-automation {
    top: 24px;
}
.cutter-region-list {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 36px;
}
.cutter-region-chip {
    display: inline-grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: stretch;
    min-width: 188px;
    max-width: 260px;
    border: 1px solid #d5deed;
    border-left: 4px solid #34c486;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 6px 16px #8ca4d014;
}
.cutter-region-chip.active {
    border-color: #ffd15f;
    box-shadow: 0 0 0 2px #ffd15f42, 0 8px 18px #8ca4d020;
}
.cutter-region-chip button {
    border: 0;
    background: transparent;
}
.chip-main {
    display: grid;
    gap: 1px;
    min-width: 0;
    padding: 7px 9px;
    text-align: left;
}
.chip-main b,
.chip-main span,
.chip-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chip-main b {
    color: #24304c;
    font-size: 0.88rem;
}
.chip-main span,
.chip-main small {
    color: #64748b;
    font-size: 0.76rem;
}
.chip-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #34a575;
    border-left: 1px solid #e3eaf5 !important;
}
.chip-play:hover,
.chip-main:hover {
    background: #f4f9ff;
}
.cutter-exportbar {
    background: rgba(255,255,255,0.9);
}
.mp3-inline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #40506d;
    font-size: 0.9rem;
    font-weight: 700;
}

/* ====== ADVANCED CONVERTER ====== */
.convert-shell {
    display: grid;
    gap: 12px;
    padding: 12px;
}
.convert-topbar,
.convert-actionbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(248,251,255,0.96);
    border: 1px solid #dbe5f4;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 8px 22px #9fb4d21f;
}
.convert-topbar {
    justify-content: space-between;
}
.convert-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.convert-title > i {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #eff8ff;
    background: linear-gradient(135deg, #4667f2 0%, #35b88a 100%);
    box-shadow: 0 8px 18px #255f7430;
}
.convert-title h5 {
    color: #24304c;
    font-weight: 850;
}
.convert-title span {
    display: block;
    color: #64748b;
    font-size: 0.9rem;
}
.convert-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.convert-dropzone {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 128px;
    border: 1.5px dashed #b9c8e4;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.82), rgba(238,245,255,0.82)),
        repeating-linear-gradient(135deg, transparent 0 12px, rgba(122,61,240,0.04) 12px 24px);
    color: #40506d;
    cursor: pointer;
    transition: border-color .16s, background .16s, box-shadow .16s;
}
.convert-dropzone:focus-visible {
    outline: 3px solid #7a3df040;
    outline-offset: 2px;
}
.convert-dropzone.is-dragover {
    border-color: #34c486;
    background: #ecfff6;
    box-shadow: inset 0 0 0 2px #34c48640;
}
.convert-file-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #ffffff;
    background: #252b35;
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 8px 18px #22324d24;
}
.convert-file-trigger:hover {
    background: #303846;
}
.convert-file-trigger input[type="file"] {
    display: none;
}
.convert-dropzone small {
    color: #64748b;
    text-align: center;
}
.convert-queue {
    display: grid;
    gap: 8px;
}
.convert-empty {
    position: static;
    inset: auto;
    display: block;
    padding: 12px;
    border: 1px solid #dbe5f4;
    border-radius: 8px;
    background: rgba(255,255,255,0.72);
    color: #708097;
}
.convert-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) minmax(140px, 220px) auto auto auto;
    gap: 9px;
    align-items: center;
    padding: 9px;
    border: 1px solid #dbe5f4;
    border-left: 4px solid #7a8aa6;
    border-radius: 8px;
    background: rgba(255,255,255,0.88);
    box-shadow: 0 6px 16px #8ca4d014;
}
.convert-row[data-status="running"] {
    border-left-color: #4667f2;
}
.convert-row[data-status="done"] {
    border-left-color: #34c486;
}
.convert-row[data-status="error"] {
    border-left-color: #d14c5a;
}
.convert-row-index {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #eef3ff;
    color: #40506d;
    font-weight: 850;
}
.convert-row-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.convert-row-main b,
.convert-row-main span,
.convert-row-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.convert-row-main b {
    color: #24304c;
}
.convert-row-main span {
    color: #64748b;
    font-size: 0.82rem;
}
.convert-error {
    color: #c84a55;
}
.convert-row-progress,
.convert-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe7f4;
}
.convert-row-progress > div,
.convert-progress > div {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #4667f2, #34c486);
    transition: width .18s ease;
}
.convert-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
}
.convert-status.queued {
    background: #eef2fa;
    color: #637083;
}
.convert-status.running {
    background: #e7edff;
    color: #4667f2;
}
.convert-status.done {
    background: #e2f8ed;
    color: #25845b;
}
.convert-status.error {
    background: #ffeded;
    color: #c84a55;
}
.convert-settings-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.convert-panel {
    display: block;
    min-width: 0;
    padding: 12px;
    border: 1px solid #dbe5f4;
    border-radius: 8px;
    background: rgba(255,255,255,0.86);
    box-shadow: 0 8px 22px #9fb4d21a;
}
.convert-panel h6 {
    margin: 0 0 9px;
    color: #24304c;
    font-weight: 850;
}
.convert-inline-slider {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 8px;
    align-items: center;
}
.convert-inline-slider input[type="range"] {
    width: 100%;
}
.convert-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #40506d;
    font-weight: 650;
}
.convert-check input {
    width: 17px;
    height: 17px;
    accent-color: #34c486;
}
.convert-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}
.convert-two-cols label {
    display: grid;
    gap: 4px;
    color: #40506d;
    font-size: 0.9rem;
    font-weight: 650;
}
.convert-actionbar {
    background: rgba(255,255,255,0.92);
}
.convert-progress {
    flex: 1 1 240px;
    min-width: 180px;
}
#convertProgressText {
    min-width: 44px;
    color: #40506d;
    font-weight: 800;
}
.convert-results {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.convert-results-title {
    flex-basis: 100%;
    color: #24304c;
    font-weight: 850;
}
.convert-result-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 360px;
    border: 1px solid #b4eac8;
    border-radius: 8px;
    background: #f0fff8;
    color: #25845b;
    padding: 7px 10px;
    font-weight: 800;
}
.convert-result-pill span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.convert-result-pill small {
    color: #64748b;
    font-weight: 700;
}

/* ====== AI VOCAL SEPARATOR ====== */
.ai-separator-shell {
    display: grid;
    gap: 12px;
    padding: 12px;
}
.ai-separator-topbar,
.ai-separator-actionbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(248,251,255,0.96);
    border: 1px solid #dbe5f4;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 8px 22px #9fb4d21f;
}
.ai-separator-topbar {
    justify-content: space-between;
}
.ai-separator-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.ai-separator-title > i {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #f7fbff;
    background: linear-gradient(135deg, #7a3df0 0%, #4667f2 48%, #34c486 100%);
    box-shadow: 0 10px 22px #3d4fa435;
}
.ai-separator-title h5 {
    color: #24304c;
    font-weight: 850;
}
.ai-separator-title span {
    display: block;
    color: #64748b;
    font-size: 0.9rem;
}
.ai-separator-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ai-separator-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #dbe5f4;
    background: #eef3ff;
    color: #40506d;
    font-size: 0.82rem;
    font-weight: 850;
}
.ai-separator-chip.ready {
    background: #e2f8ed;
    border-color: #b8e8cd;
    color: #25845b;
}
.ai-separator-chip.warn {
    background: #fff6df;
    border-color: #f4dfaa;
    color: #9b6a16;
}
.ai-separator-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
    gap: 12px;
}
.ai-separator-import,
.ai-separator-settings,
.ai-stem-card {
    min-width: 0;
    border: 1px solid #dbe5f4;
    border-radius: 8px;
    background: rgba(255,255,255,0.88);
    box-shadow: 0 8px 22px #9fb4d21a;
}
.ai-separator-import {
    display: grid;
    gap: 10px;
    padding: 12px;
}
.ai-separator-settings {
    padding: 12px;
}
.ai-separator-settings h6 {
    margin: 0 0 9px;
    color: #24304c;
    font-weight: 850;
}
.ai-separator-dropzone {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 170px;
    border: 1.5px dashed #b9c8e4;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.82), rgba(238,245,255,0.82)),
        repeating-linear-gradient(135deg, transparent 0 12px, rgba(70,103,242,0.045) 12px 24px);
    color: #40506d;
    transition: border-color .16s, background .16s, box-shadow .16s;
}
.ai-separator-dropzone.is-dragover {
    border-color: #34c486;
    background: #ecfff6;
    box-shadow: inset 0 0 0 2px #34c48640;
}
.ai-separator-file-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 15px;
    border-radius: 8px;
    color: #ffffff;
    background: #252b35;
    cursor: pointer;
    font-weight: 850;
    box-shadow: 0 8px 18px #22324d24;
}
.ai-separator-file-trigger:hover {
    background: #303846;
}
.ai-separator-file-trigger input[type="file"] {
    display: none;
}
.ai-separator-dropzone small {
    color: #64748b;
    text-align: center;
    padding: 0 12px;
}
.ai-separator-filecard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 420px);
    gap: 12px;
    align-items: center;
    padding: 11px;
    border-radius: 8px;
    background: #f7faff;
    border: 1px solid #e2e9f5;
}
.ai-separator-filecard > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.ai-separator-filecard b,
.ai-separator-filecard span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ai-separator-filecard b {
    color: #24304c;
    font-weight: 850;
}
.ai-separator-filecard span {
    color: #64748b;
    font-size: 0.86rem;
}
.ai-separator-filecard audio,
.ai-stem-card audio {
    width: 100%;
    height: 38px;
}
.ai-separator-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #40506d;
    font-weight: 650;
}
.ai-separator-check input {
    width: 17px;
    height: 17px;
    accent-color: #4667f2;
}
.ai-separator-progress {
    flex: 1 1 260px;
    min-width: 220px;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe7f4;
}
.ai-separator-progress > div {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #7a3df0, #4667f2, #34c486);
    transition: width .18s ease;
}
#separatorProgressText {
    min-width: 54px;
    color: #40506d;
    font-weight: 850;
}
.ai-separator-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.ai-stem-card {
    display: grid;
    gap: 10px;
    padding: 12px;
}
.ai-stem-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ai-stem-card-head > div {
    display: grid;
    min-width: 0;
}
.ai-stem-card-head b {
    color: #24304c;
    font-weight: 850;
}
.ai-stem-card-head span {
    color: #64748b;
    font-size: 0.84rem;
}
.speech-text-shell .ai-separator-title > i {
    background: linear-gradient(135deg, #256fd9 0%, #22a6a6 55%, #34c486 100%);
}
.speech-text-format-box {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    border: 1px solid #dbe5f4;
    border-radius: 8px;
    background: #f7faff;
}
.speech-text-format-box > span,
.speech-text-note {
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 700;
}
.speech-text-results {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dbe5f4;
    border-radius: 8px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 8px 22px #9fb4d21a;
}
.speech-text-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.speech-text-result-head > div:first-child {
    display: grid;
    gap: 2px;
}
.speech-text-result-head b {
    color: #24304c;
    font-weight: 850;
}
.speech-text-result-head span {
    color: #64748b;
    font-size: 0.86rem;
}
.speech-text-downloads {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.speech-text-transcript {
    min-height: 220px;
    max-height: 420px;
    overflow: auto;
    margin: 0;
    padding: 12px;
    border: 1px solid #e2e9f5;
    border-radius: 8px;
    background: #f8fbff;
    color: #24304c;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.92rem;
    line-height: 1.55;
}

/* ====== LIST, SIDEBAR ====== */
#sidebar {
    background: rgba(248,251,255,0.98);
    border-radius: 8px;
    box-shadow: 0 8px 24px #8ca4d016;
    border: 1.5px solid #eaf0fa;
    padding: 12px;
}
#sidebar h5 {
    margin: 0;
    color: #2f3a59;
    font-weight: 850;
}
.sidebar-head {
    gap: 10px;
}
.icon-plus-btn {
    width: 40px;
    height: 40px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.list-group {
    background: transparent;
    border-radius: 8px;
    border: none;
    padding: 0;
    gap: 7px;
    display: grid;
}
.tracklist-track.active,
.list-group-item.active,
.list-group-item:focus {
    background: linear-gradient(90deg, #eef4ff 0%, #f8fbff 100%) !important;
    border-color: color-mix(in srgb, var(--track-accent, #7a3df0) 45%, #cbd7ef);
    color: #1f2b4f;
}
.list-group-item {
    font-size: 0.95rem;
    border: 1px solid #e2eaf7;
    border-left: 4px solid var(--track-accent, #7a3df0);
    border-radius: 8px !important;
    background: rgba(255,255,255,0.78);
    transition: background .14s, border-color .14s, transform .14s, box-shadow .14s;
    padding: 10px;
}
.list-group-item:hover {
    background: #f7fbff !important;
    border-color: color-mix(in srgb, var(--track-accent, #7a3df0) 40%, #cbd7ef);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px #90a6cc20;
}
.tracklist-track {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    cursor: pointer;
}
.tracklist-main {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.tracklist-index {
    color: #1f2b4f;
    font-size: 0.95rem;
    font-weight: 850;
    line-height: 1.1;
}
.tracklist-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #2d3448;
    line-height: 1.25;
}
.tracklist-status {
    width: fit-content;
    padding: 2px 7px;
    border-radius: 7px;
    background: #eef2fa;
    color: #708097;
    font-size: 0.72rem;
    font-weight: 750;
}
.tracklist-status.loaded {
    background: #e2f8ed;
    color: #25845b;
}
.tracklist-actions {
    display: grid;
    grid-auto-flow: column;
    gap: 6px;
    align-items: center;
}
.sidebar-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d5deed;
    border-radius: 8px;
    background: #ffffff;
    color: #46546f;
    transition: background .14s, color .14s, border-color .14s;
}
.sidebar-icon-btn:hover {
    background: #edf4ff;
    color: #293d72;
    border-color: #b8c8e6;
}
.sidebar-icon-btn.danger {
    color: #c54b55;
    border-color: #ffd0d0;
}
.sidebar-icon-btn.danger:hover {
    background: #fff0f0;
    border-color: #ffb5b5;
}
input[type="range"] {
    width: 104px;
    accent-color: #7a3df0;
    cursor: pointer;
}

/* ====== FILE & BUTTON ====== */
input[type="file"] {
    background: #f7fafd;
    border-radius: 8px;
    border: 1px solid #e4eafc;
    font-size: 0.97rem;
    padding: 3px 7px;
}
.file-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #6f7a8d;
    border-radius: 8px;
    color: #dce6f7;
    background: #2a303b;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .15s;
}
.file-icon-btn:hover {
    background: #333b49;
    border-color: var(--track-accent, #34c486);
    transform: translateY(-1px);
}
.file-icon-btn input[type="file"] {
    display: none;
}
.icon-only-btn {
    width: 34px;
    height: 34px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}
.btn {
    font-size: 0.97rem;
    border-radius: 8px !important;
    padding: 5px 15px !important;
    box-shadow: 0 1px 3px #cad9f80d;
    transition: background .15s, color .15s, box-shadow .17s;
}
.btn.icon-only-btn {
    width: 34px;
    height: 34px;
    padding: 0 !important;
}
.btn-primary { background: #7a3df0; border: none; }
.btn-primary:hover, .btn-primary:focus { background: #6549c7; }
.btn-outline-secondary { color: #333; border: 1.2px solid #b4bbd6; }
.btn-outline-secondary:hover { background: #f6f6f9; }
.btn-success { background: #43b78a; border: none; }
.btn-outline-success { color: #43b78a; border: 1.2px solid #b4eac8;}
.btn-outline-success:hover { background: #e8fbf4;}
.btn-outline-primary { color: #6a6cd5; border: 1.2px solid #b4bbf0;}
.btn-outline-primary:hover { background: #eaf0ff; }
.btn-danger, .btn-outline-danger { border: 1.2px solid #ffc2c2; background: #ffeded; color: #ca3d45;}
.btn-outline-danger:hover { background: #ffe2e2; }

.alert-info {
    background: linear-gradient(90deg, #eef3ff 80%, #f8faff 100%);
    color: #294078;
    border-radius: 8px;
    border: 1.2px solid #bedafd;
}

/* ====== STATUS, TOOLTIP ====== */
#exportStatus, #cutterExportStatus, #convertStatus {
    min-height: 28px;
    font-size: 1.08rem;
    font-weight: 500;
    margin-top: 8px;
}
#region-tooltip {
    position: fixed;
    z-index: 9999;
    background: #212333eb;
    color: #fff;
    padding: 4px 15px;
    border-radius: 8px;
    font-size: 1.05rem;
    pointer-events: none;
    display: none;
    box-shadow: 0 4px 16px #4443;
    letter-spacing: 0.01em;
    font-weight: 500;
}

.mobile-rotate-tip {
    display: none;
}

/* ====== GUIDE MODAL ====== */
.guide-modal-dialog {
    width: min(1420px, calc(100vw - 32px));
    max-width: min(1420px, calc(100vw - 32px));
}
.guide-modal {
    max-height: calc(100vh - 42px);
    overflow: hidden;
    border: 1px solid #dbe5f4;
    border-radius: 10px;
}
.guide-modal-header {
    align-items: center;
    gap: 16px;
    background: linear-gradient(120deg, #eef3ff 0%, #f8fbff 100%);
    border-bottom: 1px solid #dbe5f4;
}
.guide-modal-header h5 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #24304c;
    font-size: 1.24rem;
}
.guide-modal-header span {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 0.9rem;
}
.guide-modal-body {
    padding: 0;
    background: #f7faff;
}
.guide-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    min-height: 430px;
    max-height: calc(100vh - 168px);
}
.guide-tabs {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 14px;
    overflow-y: auto;
    border-right: 1px solid #dbe5f4;
    background: #eef3ff;
}
.guide-tabs .nav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    width: 100%;
    min-height: 42px;
    padding: 9px 11px !important;
    border: 1px solid transparent;
    border-radius: 8px !important;
    color: #40506d;
    font-weight: 800;
    text-align: left;
    white-space: nowrap;
}
.guide-tabs .nav-link i {
    width: 19px;
    text-align: center;
}
.guide-tabs .nav-link.active {
    background: #ffffff;
    color: #6b44d8 !important;
    border-color: #d6e0f3;
    box-shadow: 0 8px 18px #6880bd1c;
}
.guide-content {
    min-width: 0;
    padding: 14px;
    overflow: auto;
}
.guide-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 12px;
}
.guide-card {
    min-width: 0;
    min-height: 142px;
    padding: 14px;
    border: 1px solid #dbe5f4;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 18px #9fb4d214;
}
.guide-card h6 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 9px;
    color: #24304c;
    font-size: 0.98rem;
    font-weight: 850;
}
.guide-card h6 i {
    color: #6b44d8;
}
.guide-card p {
    margin: 0;
    color: #40506d;
    font-size: 0.94rem;
    line-height: 1.55;
}
.guide-card code {
    color: #6b44d8;
    background: #eef3ff;
    border-radius: 6px;
    padding: 1px 5px;
}
.guide-card kbd {
    border-radius: 6px;
    background: #222936;
    box-shadow: inset 0 -1px 0 #00000040;
}
.guide-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 7px;
    background: #4667f2;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 850;
    white-space: nowrap;
}

/* ====== FOOTER ====== */
.footer-main {
    box-shadow: 0 -2px 16px #b9cbe930;
    letter-spacing: 0.01em;
    background: rgba(255, 248, 220, 0.96);
	text-decoration: none !important;
}
.footer-main a:hover {
    color: #7a3df0 !important;
    text-decoration: underline !important;
}

/* ====== MOBILE RESPONSIVE ====== */
@media (max-width: 991px) {
    :root { --track-header-width: 170px; --cutter-header-width: 170px; }
    .track-controls {gap: 6px; font-size: 0.82rem;}
    .track-waveform {min-width:180px;}
    .track-slider-row { grid-template-columns: 1fr 62px; }
    .track-slider-row input[type="range"] { width: 62px; }
    .single-cutter-track-head .track-file-name {max-width: 132px;}
    .convert-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .convert-row { grid-template-columns: 34px minmax(0, 1fr) minmax(110px, 170px) auto auto auto; }
    .ai-separator-grid,
    .ai-separator-results { grid-template-columns: 1fr; }
    .ai-separator-filecard { grid-template-columns: 1fr; }
    .guide-layout { grid-template-columns: 1fr; min-height: 0; }
    .guide-tabs {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: 0;
        border-bottom: 1px solid #dbe5f4;
    }
    .guide-tabs .nav-link { width: auto; }
    .guide-card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
    .footer-main {font-size: 0.94rem;}
    :root { --track-header-width: 156px; --cutter-header-width: 156px; }
    .track-controls {gap: 5px;}
    .track-waveform {min-width:90px; height: 33px;}
    .tracklist-track, .list-group-item {padding: 8px 9px;}
    .container-fluid {padding-left: 3px !important; padding-right: 3px !important;}
    header {padding-left: 5px !important; padding-right: 5px !important;}
    .single-cutter-toolbar,
    .single-cutter-editbar,
    .cutter-exportbar {align-items: flex-start;}
    .tool-control {width: 100%; justify-content: flex-start;}
    .single-cutter-track-head .track-file-name {max-width: 118px;}
    .convert-topbar,
    .convert-actionbar {align-items: flex-start;}
    .convert-settings-grid { grid-template-columns: 1fr; }
    .convert-row {
        grid-template-columns: 30px minmax(0, 1fr) auto auto;
    }
    .convert-row-progress,
    .convert-status {
        grid-column: 2 / -1;
    }
    .convert-progress { flex-basis: 100%; }
    .ai-separator-topbar,
    .ai-separator-actionbar {align-items: flex-start;}
    .ai-separator-progress {flex-basis: 100%; min-width: 100%;}
    .ai-stem-card-head {align-items: flex-start; flex-direction: column;}
    .ai-separator-top-actions {width: 100%;}
    .guide-modal-dialog {
        width: calc(100vw - 12px);
        max-width: calc(100vw - 12px);
        margin: 6px auto;
    }
    .guide-modal {max-height: calc(100vh - 12px);}
    .guide-modal-header h5 {font-size: 1.04rem;}
    .guide-modal-header span {font-size: 0.82rem;}
    .guide-layout {max-height: calc(100vh - 160px);}
    .guide-content {padding: 10px;}
    .guide-card {min-height: auto; padding: 12px;}
}

::-webkit-scrollbar {height: 8px;}
::-webkit-scrollbar-thumb {background: #dbe2f4;border-radius:7px;}
::-webkit-scrollbar-track {background: #f8faff;}

/* ====== MOBILE APP SHELL ====== */
@media (max-width: 767px) {
    html {
        min-height: 100%;
        background: #eef3ff;
    }

    body {
        min-height: 100svh;
        padding-bottom: calc(78px + env(safe-area-inset-bottom));
        background: #eef3ff;
        overscroll-behavior-y: contain;
    }

    body::before {
        opacity: 0.08;
        filter: blur(10px);
    }

    .app-header {
        min-height: 56px;
        padding-top: calc(8px + env(safe-area-inset-top)) !important;
        padding-bottom: 8px !important;
        gap: 8px;
        flex-wrap: nowrap;
        box-shadow: 0 10px 24px #11182730;
    }

    .brand-lockup {
        flex: 1 1 auto;
        min-width: 0;
        gap: 8px !important;
        padding-right: 88px;
    }

    .brand-lockup img {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }

    .brand-title {
        max-width: calc(100vw - 150px);
        overflow: hidden;
        white-space: normal;
        font-size: 0.9rem;
        line-height: 1.12;
    }

    .app-nav {
        position: fixed;
        top: calc(8px + env(safe-area-inset-top));
        right: 8px;
        z-index: 120;
        flex: 0 0 auto;
        gap: 6px;
        margin-left: auto;
    }

    .app-nav a {
        width: 38px;
        height: 38px;
        justify-content: center;
        padding: 0;
        border-radius: 10px;
        background: rgba(255,255,255,0.08);
        color: #ffffff !important;
        font-size: 0.95rem;
    }

    .app-nav a span {
        display: none;
    }

    .app-nav a i,
    .app-nav a i::before {
        font-size: 1.08rem;
    }

    .mobile-rotate-tip {
        position: sticky;
        top: calc(56px + env(safe-area-inset-top));
        z-index: 90;
        align-items: flex-start;
        gap: 9px;
        margin: 8px;
        padding: 10px 12px;
        border: 1px solid #cdd9ee;
        border-left: 4px solid #4667f2;
        border-radius: 12px;
        background: rgba(248, 251, 255, 0.96);
        color: #263452;
        box-shadow: 0 10px 22px #1b2c4f1c;
        backdrop-filter: blur(12px);
        font-size: 0.86rem;
        line-height: 1.35;
    }

    .mobile-rotate-tip i {
        color: #4667f2;
        font-size: 1.2rem;
        line-height: 1.15;
    }

    .mobile-rotate-tip span {
        min-width: 0;
    }

    .app-shell {
        margin-top: 8px !important;
        margin-bottom: 0 !important;
        padding: 0 8px calc(88px + env(safe-area-inset-bottom)) !important;
    }

    #editorTabs {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 4px;
        width: 100%;
        box-sizing: border-box;
        margin: 0 !important;
        padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
        border-radius: 16px 16px 0 0;
        border-top: 1px solid rgba(206, 217, 238, 0.92);
        background: rgba(248, 251, 255, 0.96);
        box-shadow: 0 -12px 28px #18233a2e;
        backdrop-filter: blur(14px);
    }

    #editorTabs .nav-item {
        flex: 1 1 0 !important;
        min-width: 0;
        max-width: 25%;
        width: auto !important;
    }

    #editorTabs .nav-link {
        width: 100%;
        min-height: 56px;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
        padding: 5px 2px !important;
        border-radius: 12px !important;
        font-size: 0.68rem;
        line-height: 1.08;
        text-align: center;
        white-space: normal;
    }

    #editorTabs .nav-link i {
        font-size: 1.16rem;
        line-height: 1;
    }

    #tabMixer > .row {
        gap: 8px;
        margin: 0;
    }

    #sidebar {
        padding: 10px;
        margin-bottom: 8px;
        border-right: 0 !important;
        border-radius: 12px;
    }

    .sidebar-head {
        margin-bottom: 8px !important;
    }

    .list-group {
        display: flex;
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .tracklist-track {
        flex: 0 0 min(260px, 82vw);
        min-height: 74px;
        scroll-snap-align: start;
    }

    #mainArea {
        padding: 0 !important;
    }

    #mainArea > .mb-2.d-flex {
        position: sticky;
        top: calc(64px + env(safe-area-inset-top));
        z-index: 35;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        margin: 0 0 8px !important;
        padding: 8px;
        border: 1px solid #dbe5f4;
        border-radius: 12px;
        background: rgba(248, 251, 255, 0.96);
        box-shadow: 0 8px 18px #1b2c4f16;
        -webkit-overflow-scrolling: touch;
    }

    #mainArea > .mb-2.d-flex .btn {
        flex: 0 0 auto;
        min-height: 40px;
        white-space: nowrap;
    }

    :root {
        --track-header-width: 142px;
        --cutter-header-width: 142px;
    }

    #timeline,
    .single-cutter-editor {
        min-height: calc(100svh - 286px) !important;
        padding: 8px !important;
        border-radius: 12px !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-x pan-y;
    }

    .mix-session-toolbar,
    .mix-edit-toolbar {
        max-width: calc(100vw - 28px);
        overflow-x: auto;
        flex-wrap: nowrap !important;
        border-radius: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .mix-session-toolbar > *,
    .mix-edit-toolbar > * {
        flex: 0 0 auto;
    }

    .track-controls,
    .single-cutter-track-head {
        padding: 8px;
        gap: 6px;
    }

    .track-file-name,
    .single-cutter-track-head .track-file-name {
        max-width: 112px;
    }

    .track-slider-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

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

    .btn,
    .file-icon-btn,
    .sidebar-icon-btn,
    .icon-only-btn {
        min-height: 40px;
    }

    .btn.icon-only-btn,
    .file-icon-btn,
    .sidebar-icon-btn {
        width: 40px;
        height: 40px;
    }

    .single-cutter-shell,
    .convert-shell,
    .ai-separator-shell {
        gap: 10px;
        padding: 0;
    }

    .single-cutter-topbar,
    .convert-topbar,
    .ai-separator-topbar,
    .single-cutter-toolbar,
    .single-cutter-editbar,
    .cutter-exportbar,
    .convert-actionbar,
    .ai-separator-actionbar {
        align-items: stretch;
        border-radius: 12px;
        padding: 10px;
    }

    .single-cutter-topbar,
    .convert-topbar,
    .ai-separator-topbar {
        flex-direction: column;
    }

    .single-cutter-title > i,
    .convert-title > i,
    .ai-separator-title > i {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
    }

    .cutter-file-name,
    .convert-title span,
    .ai-separator-title span {
        max-width: 100%;
        font-size: 0.82rem;
        white-space: normal;
    }

    .single-cutter-actions,
    .convert-top-actions,
    .ai-separator-top-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .tool-control {
        flex: 1 1 100%;
        min-width: 0;
    }

    .tool-control input[type="range"] {
        flex: 1 1 auto;
        width: auto;
        min-width: 96px;
    }

    .tool-control.ms-auto {
        margin-left: 0 !important;
    }

    .cutter-region-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
    }

    .cutter-region-chip {
        flex: 0 0 220px;
    }

    .mp3-inline {
        flex: 1 1 100%;
        flex-wrap: wrap;
    }

    .convert-dropzone,
    .ai-separator-dropzone {
        min-height: 112px;
        padding: 12px;
        border-radius: 12px;
    }

    .convert-file-trigger,
    .ai-separator-file-trigger {
        width: 100%;
        justify-content: center;
        min-height: 46px;
        text-align: center;
    }

    .convert-panel,
    .ai-separator-import,
    .ai-separator-settings,
    .ai-stem-card {
        border-radius: 12px;
    }

    .convert-two-cols {
        grid-template-columns: 1fr;
    }

    .convert-row {
        grid-template-columns: 30px minmax(0, 1fr) auto;
        gap: 8px;
    }

    .convert-row-progress,
    .convert-status {
        grid-column: 2 / -1;
    }

    .convert-row .icon-only-btn {
        width: 38px;
        height: 38px;
    }

    .convert-progress,
    .ai-separator-progress {
        flex-basis: 100%;
        min-width: 100%;
    }

    .ai-separator-top-actions > *,
    .ai-separator-actionbar .btn,
    .convert-actionbar .btn,
    .cutter-exportbar .btn {
        flex: 1 1 auto;
    }

    .ai-separator-filecard {
        border-radius: 12px;
    }

    .ai-separator-filecard audio,
    .ai-stem-card audio {
        min-width: 0;
    }

    .footer-main {
        display: none;
    }
}

@media (max-width: 767px) and (orientation: portrait) {
    .mobile-rotate-tip {
        display: flex;
    }
}

@media (max-width: 767px) and (orientation: landscape) {
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    .app-header {
        min-height: 48px;
        padding-top: calc(5px + env(safe-area-inset-top)) !important;
        padding-bottom: 5px !important;
    }

    .brand-lockup img {
        width: 30px;
        height: 30px;
    }

    .brand-title {
        max-width: 46vw;
        font-size: 0.86rem;
        white-space: nowrap;
    }

    .app-shell {
        padding-bottom: calc(70px + env(safe-area-inset-bottom)) !important;
    }

    #editorTabs {
        padding-top: 4px;
    }

    #editorTabs .nav-link {
        min-height: 48px;
        font-size: 0.66rem;
    }

    #timeline,
    .single-cutter-editor {
        min-height: calc(100svh - 198px) !important;
    }
}

@media (max-height: 480px) and (orientation: landscape) {
    .app-header {
        min-height: 50px;
        padding-top: calc(6px + env(safe-area-inset-top)) !important;
        padding-bottom: 6px !important;
    }

    .brand-lockup img {
        width: 32px;
        height: 32px;
    }

    .brand-title {
        font-size: 0.98rem;
    }

    .app-shell {
        margin-top: 8px !important;
    }

    .nav-tabs {
        padding: 5px;
        gap: 4px;
    }

    .nav-tabs .nav-link {
        min-height: 42px;
        padding: 7px 12px !important;
        font-size: 0.94rem;
    }

    #sidebar {
        max-height: calc(100svh - 150px);
        overflow: auto;
    }

    #timeline,
    .single-cutter-editor {
        min-height: calc(100svh - 178px) !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-x pan-y;
    }

    .footer-main {
        display: none;
    }
}
