/* ── Recorder UI control-group ────────────────────────────────── */

.rec-inner {
    width: 100%;
    padding: 20px 4%;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
}

.rec-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Top row: dropdown + kebab menu ─────────────────────────── */

.rec-top-row {
    display: flex;
    width: 100%;
    gap: 6px;
    align-items: center;
    position: relative;
    background: #4a5568;
    padding: 6px;
    border-radius: 5px;
}

.rec-select-shell {
    position: relative;
    flex: 1;
    min-width: 0;
}

.rec-select {
    width: 100%;
    background-color: #2b3035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ffffff' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none;
    color: transparent;
    font-family: "Sofia Sans Extra Condensed", sans-serif;
    font-size: 18px;
    font-weight: 600;
    padding: 6px 28px 6px 10px;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.rec-select option {
    color: #e6eef8;
}

.rec-select-display {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 6px 28px 6px 10px;
    pointer-events: none;
    font-family: "Sofia Sans Extra Condensed", sans-serif;
    font-size: 18px;
    font-weight: 600;
}

.rec-select-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #e6eef8;
}

.rec-select-app {
    flex: 0 0 auto;
    margin-left: 4px;
    color: #8fa1b3;
    white-space: nowrap;
}

.rec-select:disabled + .rec-select-display {
    opacity: 0.7;
}

.rec-menu-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: #3a4149;
    color: #e6eef8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.rec-menu-btn:hover,
.rec-menu-btn:focus-visible {
    background: #2b3035;
}

.rec-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    display: flex;
    flex-direction: column;
    min-width: 160px;
    padding: 5px;
    border-radius: 8px;
    background: #1f2428;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
    z-index: 50;
}

.rec-menu[hidden] {
    display: none;
}

.rec-menu-item {
    border: none;
    background: transparent;
    color: #e6eef8;
    padding: 9px 11px;
    text-align: left;
    border-radius: 6px;
    font-family: "Quicksand", sans-serif;
    font-size: 13px;
    cursor: pointer;
}

.rec-menu-item:hover,
.rec-menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.rec-menu-item:disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

/* ── Seek bar row ───────────────────────────────────────────── */

.rec-seek-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
}

.rec-seek {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #3a4149;
    outline: none;
    cursor: pointer;
    width: 100%;
}

.rec-seek::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #4a90d9 0%, #4a90d9 var(--progress, 0%), #3a4149 var(--progress, 0%));
}

.rec-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e6eef8;
    border: 2px solid #4a90d9;
    margin-top: -5px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.rec-seek::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: #3a4149;
}

.rec-seek::-moz-range-progress {
    height: 6px;
    border-radius: 3px;
    background: #4a90d9;
}

.rec-seek::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e6eef8;
    border: 2px solid #4a90d9;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.rec-time {
    flex: 0 0 auto;
    font-family: "Sofia Sans Extra Condensed", sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #9eb8cb;
    min-width: 38px;
    text-align: right;
    user-select: none;
}

/* ── Button row ─────────────────────────────────────────────── */

.rec-btn-row {
    display: flex;
    width: fit-content;
    justify-content: center;
    gap: 9px;
    background: #4a5568;
    padding: 6px;
    border-radius: 5px;
}

.rec-btn-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.rec-btn-label {
    font-family: "Sofia Sans Extra Condensed", sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #9eb8cb;
    user-select: none;
}

.rec-btn {
    width: 45px;
    height: 35px;
    border: 2px solid #1A202C;
    border-radius: 4px;
    background: linear-gradient(0deg, #3f4751, transparent);
    box-shadow: 0 0 2px #000000a6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.15s;
}

.rec-btn:hover,
.rec-btn:focus-visible {
    filter: brightness(1.08);
}

/* Record icon — filled circle */
.rec-icon-circle {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d44;
}

.rec-record.active .rec-icon-circle {
    background: #f44;
    animation: rec-pulse 1s ease-in-out infinite;
}

.rec-record.pending .rec-icon-circle {
    background: #f59e0b;
    animation: rec-pulse 1s ease-in-out infinite;
}

@keyframes rec-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Play icon — triangle */
.rec-icon-play {
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 14px;
    border-color: transparent transparent transparent #4a90d9;
}

.rec-icon-stop {
    display: none;
    width: 14px;
    height: 14px;
    background: #6cb0ff;
    border-radius: 2px;
}

.rec-play.active .rec-icon-play {
    display: none;
}

.rec-play.active .rec-icon-stop {
    display: block;
}

.rec-icon-drum {
    display: block;
    width: 18px;
    height: 18px;
    filter: brightness(0) saturate(100%);
}

.rec-rhythm-sync.sync-enabled .rec-icon-drum {
    filter: brightness(0) invert(1);
}

.rec-group{
    flex-basis: 180px;
}

.rec-group.rec-pending .rec-time {
    color: #f8b84d;
}

@media (max-width: 768px) {
    .rec-inner {
        padding: 15px 4%;
    }
}

.recording-settings-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 2200;
}

.recording-settings-modal[hidden] {
    display: none;
}

.recording-settings-row[hidden],
.recording-settings-note[hidden] {
    display: none !important;
}

.recording-settings-dialog {
    width: min(100%, 440px);
    padding: 24px 28px;
    border-radius: 18px;
    background: linear-gradient(180deg, #f6f8fb 0%, #e8edf3 100%);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.35);
    color: #1f2937;
}

.recording-settings-title {
    margin: 0 0 18px;
    font-family: "Quicksand", sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
}

.recording-settings-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.recording-settings-row {
    display: grid;
    grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.recording-settings-label {
    font-family: "Quicksand", sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: #1f2937;
}

.recording-settings-select,
.recording-settings-row input[type="number"] {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #b8c3d1;
    border-radius: 10px;
    background: #ffffff;
    color: #1f2937;
    font-family: "Quicksand", sans-serif;
    font-size: 16px;
    box-sizing: border-box;
}

.recording-settings-select:disabled,
.recording-settings-row input[type="number"]:disabled {
    opacity: 0.6;
}

.recording-settings-note {
    margin-left: 164px;
    font-family: "Quicksand", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #475569;
}

.recording-settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
}

.recording-settings-btn {
    min-width: 138px;
    min-height: 44px;
    border: none;
    border-radius: 10px;
    font-family: "Quicksand", sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.recording-settings-btn:hover,
.recording-settings-btn:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.recording-settings-btn.is-cancel {
    background: #4b5563;
    color: #ffffff;
}

.recording-settings-btn.is-start {
    background: linear-gradient(180deg, #2d6ae3 0%, #2257c1 100%);
    color: #ffffff;
}

.recording-settings-btn:disabled {
    opacity: 0.7;
    cursor: progress;
    transform: none;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 768px) {
    .rec-group {
        max-width: 100%;
        min-width: 0;
    }

    .recording-settings-dialog {
        width: min(100%, 360px);
        padding: 22px 20px;
    }

    .recording-settings-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .recording-settings-note {
        margin-left: 0;
    }

    .recording-settings-actions {
        flex-direction: column;
    }

    .recording-settings-btn {
        width: 100%;
    }
}
