/* ==============================
   AUDIO TRIMMER
   Core color tokens (SoundFactory palette)
     --at-blue:    #5b8ec4   (primary accent)
     --at-blue-lt: #7ab8f5   (hover / badge)
     --at-bg:      #0e1115   (deepest bg)
     --at-surface: #1c1f23   (waveform / panels)
     --at-panel:   #232830   (toolbar / controls)
     --at-border:  #2e3340   (dividers)
     --at-text:    #c8d8ea   (primary text)
     --at-muted:   #5a6a7e   (secondary text)
   ============================== */

/* ── Reset / Base ────────────────────────────────── */

#audio-trimmer *,
#audio-trimmer *::before,
#audio-trimmer *::after {
    box-sizing: border-box;
}

#audio-trimmer {
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 40px auto !important;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: #c8d8ea;
    background: #0e1115;
    border-radius: 8px;
    border: 1px solid #2e3340;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    overflow: visible;
}

/* ── Notifications ───────────────────────────────── */

#at-notification-area {
    position: absolute;
    top: 58px;
    right: 16px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.at-notification {
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    opacity: 1;
    transition: opacity .3s;
}

.at-notification-fade    { opacity: 0; }
.at-notification-success { background: #1e7e42; }
.at-notification-error   { background: #9c2020; }
.at-notification-info    { background: #1a5fa8; }

/* ── Upload Area ─────────────────────────────────── */

#at-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 72px 30px;
    cursor: pointer;
    border-radius: 8px;
    transition: background .2s;
}

#at-upload-area:hover,
#at-upload-area.dragover {
    background: rgba(91, 142, 196, 0.05);
}

#at-upload-area.dragover {
    outline: 2px dashed #5b8ec4;
    outline-offset: -2px;
}

.at-upload-icon {
    font-size: 52px;
    color: #5b8ec4;
    opacity: 0.45;
}

#at-upload-area p {
    margin: 0;
    color: #8fa8c0;
    font-size: 16px;
}

.at-upload-hint {
    font-size: 12px !important;
    color: #3a4655 !important;
    margin: 0;
}

/* Choose file button */
.at-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    transition: all .3s cubic-bezier(.645,.045,.355,1);
    outline: none;
}

.at-btn-primary {
    background: #5b8ec4;
    border-color: #5b8ec4;
    color: #fff;
}

.at-btn-primary:hover  { background: #4a7db3; border-color: #4a7db3; }
.at-btn-primary:active { background: #3a6da3; border-color: #3a6da3; }

/* ── Toolbar ─────────────────────────────────────── */

#at-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1c2332;
    padding: 0 12px;
    height: 46px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #2e3340;
    flex-shrink: 0;
}

/* Mode tab buttons  (like el-radio-button style) */
.at-toolbar-modes {
    display: flex;
    align-items: center;
    gap: 2px;
}

.at-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #5a6a7e;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1;
    outline: none;
    transition: all .3s cubic-bezier(.645,.045,.355,1);
    white-space: nowrap;
    position: relative;
}

.at-mode-btn:hover {
    color: #7ab8f5;
    border-color: rgba(91, 142, 196, 0.3);
}

.at-mode-btn.active {
    background: rgba(91, 142, 196, 0.15);
    border-color: #5b8ec4;
    color: #7ab8f5;
}

/* Status dot — always rendered, colour depends on state */
.at-mode-btn::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: transparent;
    transition: background .2s;
}

/* Blue dot: active tab */
.at-mode-btn.active::after {
    background: #7ab8f5;
}

/* Green dot: settings changed under this mode (overrides blue) */
.at-mode-btn.has-status::after {
    background: #1de9b6;
}

/* Filename center */
.at-toolbar-info {
    flex: 1;
    min-width: 0;
    text-align: center;
    overflow: hidden;
}

#at-filename {
    display: block;
    font-size: 12px;
    color: #3a4655;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Toolbar icon buttons */
.at-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ── Shared Icon Button ───────────────────────────── */

.at-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #5a6a7e;
    cursor: pointer;
    font-size: 13px;
    outline: none;
    transition: all .3s cubic-bezier(.645,.045,.355,1);
}

.at-icon-btn:hover {
    color: #c8d8ea;
    border-color: #2e3340;
    background: rgba(255, 255, 255, 0.05);
}

.at-icon-btn:active {
    color: #7ab8f5;
}

.at-icon-btn.active {
    color: #7ab8f5;
    border-color: rgba(91, 142, 196, 0.4);
    background: rgba(91, 142, 196, 0.1);
}

.at-close-btn:hover {
    color: #f08080;
    border-color: rgba(180, 50, 50, 0.3);
    background: rgba(180, 50, 50, 0.1);
}

/* Cut mode toggle button */
.at-cut-btn.active {
    color: #7ab8f5;
    border-color: rgba(91, 142, 196, 0.45);
    background: rgba(91, 142, 196, 0.1);
}

.at-cut-btn.active:hover {
    color: #a0ccff;
    border-color: rgba(91, 142, 196, 0.65);
    background: rgba(91, 142, 196, 0.18);
}

/* ── Waveform + Overlay ───────────────────────────── */

#at-waveform-wrapper {
    position: relative;
    background: #090d12;
    min-height: 130px;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
    /* top padding to give room for handle badges */
    padding-top: 34px;
}

#at-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #0e1115;
    color: #5a6a7e;
    font-size: 13px;
    z-index: 20;
}

#at-waveform {
    width: 100%;
    display: block;
    cursor: crosshair;
}

/* ── Cut Mode Overlay ────────────────────────────── */

/* Cut mode: selection band shows the region being removed */
#at-selection-band.at-cut-mode {
    background: rgba(6, 9, 14, 0.55);
    box-shadow: inset 0 2px 0 rgba(29, 233, 182, 0.55),
                inset 0 -2px 0 rgba(29, 233, 182, 0.55);
}

/* ── Overlay ─────────────────────────────────────── */

#at-overlay {
    position: absolute;
    /* covers the waveform including the top padding */
    top: 34px;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
    overflow: visible;
}

/* Selection band — drag to slide both handles */
#at-selection-band {
    position: absolute;
    top: 0;
    height: 100%;
    pointer-events: all;
    cursor: move;
    z-index: 2;
    background: rgba(29, 233, 182, 0.07);
    box-shadow: inset 0 2px 0 rgba(29, 233, 182, 0.55),
                inset 0 -2px 0 rgba(29, 233, 182, 0.55);
}

/* ── Handles ─────────────────────────────────────── */

.at-handle {
    position: absolute;
    top: 0;
    height: 100%;
    z-index: 4;
    pointer-events: all;
    cursor: ew-resize;
    transform: translateX(-50%);
    touch-action: none;
}

/* The vertical bar */
.at-handle-bar {
    position: relative;
    width: 10px;
    height: 100%;
    background: #2dd4c4;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Outer edge of each handle is rounded */
#at-handle-left  .at-handle-bar { border-radius: 4px 0 0 4px; }
#at-handle-right .at-handle-bar { border-radius: 0 4px 4px 0; }

/* Grip — three vertically stacked dots */
.at-handle-grip {
    position: absolute;
    width: 4px;
    height: 24px;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255,255,255,0.75) 1.5px, transparent 1.5px);
    background-size: 4px 8px;
    background-repeat: repeat-y;
    background-position: center top;
    border: none;
}

/* Time badge — sits ABOVE the waveform area (in the padding space) */
.at-handle-badge {
    position: absolute;
    bottom: calc(100% + 4px);  /* above the overlay area = into the padding */
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: none;
    color: #0e1115;
    font-size: 11px;
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
    line-height: 1.4;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Arrow pointing down from badge to handle */
.at-handle-badge::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #fff;
}

/* Quick fade buttons */
.at-fade-quick-btn svg {
    display: block;
    pointer-events: none;
}

.at-fade-quick-btn.active {
    color: #1de9b6;
    border-color: rgba(29, 233, 182, 0.4);
    background: rgba(29, 233, 182, 0.1);
}

.at-fade-quick-btn.active:hover {
    color: #2dd4c4;
}

/* Selection duration label */
#at-selection-label {
    position: absolute;
    bottom: 6px;
    transform: translateX(-50%);
    font-size: 11px;
    font-family: 'Courier New', monospace;
    color: rgba(122, 184, 245, 0.55);
    pointer-events: none;
    z-index: 3;
    white-space: nowrap;
}

/* Filename label — centered inside the waveform canvas */
#at-waveform-label {
    position: absolute;
    top: 34px;   /* below padding, sits over the waveform */
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: rgba(200, 216, 234, 0.22);
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 20px;
    letter-spacing: 0.3px;
}

/* ── Fade Panel ───────────────────────────────────── */

#at-fade-panel {
    background: #161a1e;
    border-top: 1px solid #2e3340;
    padding: 14px 20px;
    display: flex;
    gap: 24px;
    flex-shrink: 0;
}

.at-fade-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.at-fade-row label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #5a6a7e;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
    min-width: 74px;
    cursor: default;
}

.at-fade-val {
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: #7ab8f5;
    font-weight: 700;
    min-width: 38px;
}

/* Range slider — mp3cut style */
.at-fade-row input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 2px;
    background: #2e3340;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: background .3s cubic-bezier(.645,.045,.355,1);
}

.at-fade-row input[type="range"]:hover {
    background: #3a4655;
}

.at-fade-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #5b8ec4;
    border: 2px solid #5b8ec4;
    cursor: pointer;
    transition: background .3s cubic-bezier(.645,.045,.355,1),
                transform .15s;
}

.at-fade-row input[type="range"]::-webkit-slider-thumb:hover {
    background: #7ab8f5;
    border-color: #7ab8f5;
    transform: scale(1.15);
}

.at-fade-row input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 2px solid #5b8ec4;
    border-radius: 50%;
    background: #5b8ec4;
    cursor: pointer;
}

/* ── EQ Panel ────────────────────────────────────── */

#at-eq-panel {
    background: #161a1e;
    border-top: 1px solid #2e3340;
    padding: 12px 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-shrink: 0;
}

/* Preset buttons row */
.at-eq-presets {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #1c2030;
    scrollbar-width: none;
    flex-shrink: 0;
}

.at-eq-presets::-webkit-scrollbar { display: none; }

.at-eq-preset {
    padding: 4px 10px;
    white-space: nowrap;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #5a6a7e;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: all .2s;
}

.at-eq-preset:hover {
    color: #c8d8ea;
    border-color: #2e3340;
}

.at-eq-preset.active {
    color: #7ab8f5;
    border-color: #5b8ec4;
    background: rgba(91, 142, 196, 0.15);
    font-weight: 600;
}

/* Sliders + sidebar row */
.at-eq-body {
    display: flex;
    align-items: stretch;
    gap: 16px;
}

.at-eq-grid {
    display: flex;
    align-items: flex-end;
    gap: 0;
    flex: 1;
}

.at-eq-band {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

/* dB readout above slider */
.at-eq-db {
    font-size: 11px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #2dd4c4;
    min-width: 30px;
    text-align: center;
    line-height: 1;
}

.at-eq-db::after { content: ' dB'; font-weight: 400; color: #3a4655; }

/* Vertical slider container */
.at-eq-track {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
}

/* Vertical range slider */
.at-eq-slider {
    -webkit-appearance: none;
    appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 4px;
    height: 72px;
    background: #2e3340;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: background .2s;
}

.at-eq-slider:hover { background: #3a4655; }

.at-eq-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2dd4c4;
    border: 2px solid #2dd4c4;
    cursor: pointer;
    transition: background .2s, transform .15s;
}

.at-eq-slider::-webkit-slider-thumb:hover {
    background: #1de9b6;
    border-color: #1de9b6;
    transform: scale(1.2);
}

.at-eq-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 2px solid #2dd4c4;
    border-radius: 50%;
    background: #2dd4c4;
    cursor: pointer;
}

/* Frequency label below slider */
.at-eq-hz {
    font-size: 10px;
    color: #3a4655;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

/* dB scale + Flat button on the right */
.at-eq-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 22px; /* aligns with hz label row */
    gap: 0;
    min-width: 36px;
    border-left: 1px solid #2e3340;
    padding-left: 12px;
}

.at-eq-scale-label {
    font-size: 10px;
    font-family: 'Courier New', monospace;
    color: #3a4655;
    line-height: 1;
}

.at-eq-scale-mid { color: #5a6a7e; }

.at-eq-flat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    background: transparent;
    border: 1px solid #2e3340;
    border-radius: 3px;
    color: #5a6a7e;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: all .2s;
    white-space: nowrap;
}

.at-eq-flat-btn:hover {
    border-color: #2dd4c4;
    color: #2dd4c4;
}

/* ── Toolbar Reset Button ────────────────────────── */

.at-toolbar-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #5a6a7e;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    outline: none;
    white-space: nowrap;
    transition: all .3s cubic-bezier(.645,.045,.355,1);
}

.at-toolbar-reset-btn:hover {
    color: #c8d8ea;
    border-color: #2e3340;
    background: rgba(255, 255, 255, 0.05);
}

.at-toolbar-reset-btn:active {
    color: #7ab8f5;
}

/* ── Speed Panel ─────────────────────────────────── */

#at-speed-panel {
    background: #161a1e;
    border-top: 1px solid #2e3340;
    padding: 14px 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.at-speed-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.at-speed-icon {
    color: #3a4655;
    flex-shrink: 0;
    transition: color .2s;
}

.at-speed-val {
    font-size: 13px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #7ab8f5;
    min-width: 42px;
    text-align: right;
    flex-shrink: 0;
}

.at-speed-row input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 2px;
    background: #2e3340;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: background .3s;
}

.at-speed-row input[type="range"]:hover {
    background: #3a4655;
}

.at-speed-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #5b8ec4;
    border: 2px solid #5b8ec4;
    cursor: pointer;
    transition: background .3s, transform .15s;
}

.at-speed-row input[type="range"]::-webkit-slider-thumb:hover {
    background: #7ab8f5;
    border-color: #7ab8f5;
    transform: scale(1.15);
}

.at-speed-row input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 2px solid #5b8ec4;
    border-radius: 50%;
    background: #5b8ec4;
    cursor: pointer;
}

/* ── Volume Panel ────────────────────────────────── */

#at-volume-panel {
    background: #161a1e;
    border-top: 1px solid #2e3340;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.at-volume-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.at-volume-row label {
    color: #5a6a7e;
    font-size: 12px;
    white-space: nowrap;
    min-width: 52px;
}

#at-volume-slider {
    flex: 1;
    accent-color: #1de9b6;
}

.at-volume-val {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: #7ab8f5;
    min-width: 44px;
    text-align: right;
    flex-shrink: 0;
}

.at-normalize-btn {
    padding: 4px 14px;
    background: transparent;
    border: 1px solid #2e3340;
    border-radius: 4px;
    color: #c8d8ea;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, color .15s;
}

.at-normalize-btn:hover {
    border-color: #1de9b6;
    color: #1de9b6;
}

.at-speed-presets {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.at-speed-preset {
    flex: 1;
    padding: 4px 0;
    background: #1c2332;
    border: 1px solid #2e3340;
    border-radius: 4px;
    color: #5a6a7e;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    text-align: center;
    transition: all .2s;
    white-space: nowrap;
}

.at-speed-preset:hover {
    border-color: #5b8ec4;
    color: #7ab8f5;
}

.at-speed-preset.active {
    background: rgba(91, 142, 196, 0.15);
    border-color: #5b8ec4;
    color: #7ab8f5;
}

/* ── Bottom Controls Bar ─────────────────────────── */

#at-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    background: #161a1e;
    border-top: 1px solid #2e3340;
    border-radius: 0 0 8px 8px;
    gap: 10px;
    flex-shrink: 0;
}

.at-controls-left,
.at-controls-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.at-controls-center {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

/* Time steppers */
.at-stepper {
    display: flex;
    align-items: stretch;
    background: #1c2332;
    border: 1px solid #2e3340;
    border-radius: 6px;
    overflow: hidden;
    height: 36px;
    transition: border-color .2s;
}

.at-stepper:hover {
    border-color: #3a4a5e;
}

.at-stepper-val {
    padding: 0 10px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #c8d8ea;
    min-width: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    user-select: none;
    letter-spacing: 0.5px;
}

.at-stepper-arrows {
    display: flex;
    flex-direction: column;
    border-left: 1px solid #2e3340;
}

.at-stepper-btn {
    flex: 1;
    width: 20px;
    background: transparent;
    border: none;
    color: #3a4a5e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    outline: none;
    font-size: 10px;
    transition: background .12s, color .12s;
    line-height: 1;
}

.at-stepper-btn:not(:last-child) {
    border-bottom: 1px solid #2e3340;
}

.at-stepper-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #c8d8ea;
}

.at-stepper-btn:active {
    background: rgba(29, 233, 182, 0.12);
    color: #1de9b6;
}

/* Circular play button */
.at-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: #2e3340;
    border: 1px solid #3a4655;
    border-radius: 50%;
    color: #c8d8ea;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all .3s cubic-bezier(.645,.045,.355,1);
    flex-shrink: 0;
}

.at-play-btn:hover {
    background: #3a4655;
    border-color: #5b8ec4;
    color: #fff;
}

.at-play-btn:active {
    background: #1a5fa8;
    border-color: #1a5fa8;
}

.at-play-btn.playing {
    background: #1a5fa8;
    border-color: #5b8ec4;
    color: #fff;
}

/* ── Format Selector ─────────────────────────────── */

.at-format-wrapper {
    position: relative;
}

.at-format-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 12px;
    height: 36px;
    background: #232830;
    border: 1px solid #2e3340;
    border-radius: 4px;
    color: #c8d8ea;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    text-transform: uppercase;
    letter-spacing: .5px;
    transition: all .3s cubic-bezier(.645,.045,.355,1);
}

.at-format-btn:hover {
    border-color: #5b8ec4;
    color: #7ab8f5;
}

.at-format-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    min-width: 150px;
    padding: 4px 0;
    background: #1c2332;
    border: 1px solid #2e3340;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    z-index: 200;
}

.at-format-option {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #c8d8ea;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    outline: none;
    transition: background .2s, color .2s;
}

.at-format-option strong {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.at-format-option span {
    font-size: 11px;
    font-weight: 400;
    color: #6b7a8d;
    margin-top: 1px;
}

.at-format-option:hover {
    background: rgba(91, 142, 196, 0.15);
}

.at-format-option:hover strong {
    color: #7ab8f5;
}

/* ── Save Button ─────────────────────────────────── */

.at-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 24px;
    height: 36px;
    background: #fff;
    border: 1px solid #fff;
    border-radius: 4px;
    color: #0e1115;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    white-space: nowrap;
    transition: all .3s cubic-bezier(.645,.045,.355,1);
}

.at-save-btn:hover {
    background: #dce9f5;
    border-color: #dce9f5;
}

.at-save-btn:active {
    background: #c0d8ef;
    border-color: #c0d8ef;
    outline: none;
}

.at-save-btn:disabled {
    background: rgba(255, 255, 255, 0.25);
    border-color: transparent;
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
}

/* ── Fullscreen ──────────────────────────────────── */

#audio-trimmer:fullscreen {
    border-radius: 0;
    margin: 0 !important;
    height: 100vh;
    overflow-y: auto;
}

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 620px) {
    #at-toolbar {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 10px;
        gap: 6px;
    }

    .at-toolbar-info {
        order: 3;
        width: 100%;
        text-align: left;
        padding-bottom: 4px;
    }

    #at-fade-panel {
        flex-direction: column;
        gap: 12px;
    }

    #at-controls-bar {
        flex-wrap: wrap;
    }

    .at-controls-right {
        flex: 1;
        justify-content: flex-end;
    }

    .at-save-btn {
        flex: 1;
        justify-content: center;
    }

    /* Wider touch targets for trim handles */
    .at-handle-bar {
        width: 20px;
    }
}
