

body {
    font-family: "GSans", "Segoe UI", Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(180deg, var(--bg), var(--bg-2));
    color: var(--text);
}

.container {
    max-width: 900px;
    margin: auto;
    padding: 24px 0 40px;
}

h1, h3, h5 {
    margin-bottom: 6px;
    margin-top: 0;
    font-weight: 600;
    color: var(--text-strong);
}

.nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.nav a {
    display: inline-block;
    padding: 8px 16px;
    background: var(--panel);
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid var(--border);
    transition: all .15s ease;
}

.nav a:hover {
    background: var(--panel-light);
    color: var(--text);
}

.nav a.active {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}


.section {
    margin-bottom: 20px;
    padding: 18px;
    background: var(--panel);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

h1, h3, h5 {
    color: var(--text-strong);
    margin-top: 0;
    font-weight: 600;
}

label {
    display: block;
    margin-top: 10px;
    color: var(--text-dim);
}


input:not([type="radio"]):not([type="checkbox"]),
select,
textarea {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    background: var(--panel-light);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
}

button {
    padding: 12px;
    background: var(--accent);
    border: none;
    color: var(--on-accent);
    font-size: 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: all .2s ease;
}

button:hover {
    background: var(--accent-soft);
}

.output {
    margin-top: 15px;
    font-size: 14px;
    color: var(--text-dim);
}


#progressContainer {
    width: 100%;
    height: 10px;
    background: var(--bg-deep);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 15px;
}

#progressBar {
    height: 100%;
    width: var(--progress-width, 0%);
    background: linear-gradient(90deg, var(--accent), var(--accent-soft));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.2s;
}

#progressText {
    color: var(--text-strong);
    font-weight: bold;
    font-size: 13px;
}

.status-done {
    color: var(--success);
    font-weight: bold;
}


#log {
    line-height: 18px;
    height: calc(18px * 40);
    overflow-y: auto;
    overflow-x: hidden;
    font-family: monospace;
    padding: 10px;
    border: 1px solid var(--border);
    background: var(--bg-deep);
    color: var(--text);
    white-space: pre-wrap;
    border-radius: 8px;
}


.output { margin-top: 15px; font-size: 14px; color: var(--text-dim); }

.hint   { font-size: 13px; color: var(--text-dim); margin-top: 6px; }

.status-done { color: var(--success); font-weight: bold; }

.status-text { font-size: 13px; color: var(--text-dim); margin-top: 4px; }


#log {
    line-height: 18px;
    height: calc(18px * 30);
    overflow-y: auto;
    overflow-x: hidden;
    font-family: monospace;
    padding: 10px;
    border: 1px solid var(--border);
    background: var(--bg-deep);
    color: var(--text);
    white-space: pre-wrap;
    border-radius: 8px;
    margin-top: 10px;
}


.footer {
    margin-top: 40px;
    padding: 20px;
    background: var(--panel);
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13px;
    text-align: center;
}

.footer {
    margin-top: 40px;
    padding: 24px 20px;
    background: var(--panel);
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13px;
}
.msg-box {
    margin-top: 8px;
    display: flex;
    gap: 6px;
}

.msg-box input {
    flex: 1;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--panel-light);
    color: var(--text);
    font-size: 12px;
}

.msg-box button {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--on-accent);
    cursor: pointer;
    font-size: 12px;
}

.msg-status {
    transition: color .15s ease;
}

.mt8 {
    margin-top: 8px;
}

.mt30 {
    margin-top: 30px;
}





.log-line {
    padding: 4px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-word;
}



.json-container {
    margin-left: calc(var(--json-depth, 0) * 12px);
    font-family: monospace;
}



.json-toggle {
    cursor: pointer;
    user-select: none;
    padding: 2px 0;
}

.json-toggle-object {
    color: var(--accent-soft);
}

.json-toggle-array {
    color: var(--warn);
}



.json-row {
    padding: 2px 0;
    color: var(--text);
}

.json-key {
    color: var(--success);
}



.json-array-item {
    padding: 2px 0;
    color: var(--text-dim);
}

.vidRes1{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:8px;
}



#downloads .vidRes1 a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.1rem;
    border-radius: 0.4rem;
    background: rgba(59, 130, 246, 0.13);
    color: var(--accent-pale);
    border: 1px solid rgba(59, 130, 246, 0.28);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s ease, border-color 0.15s ease;
}

#downloads .vidRes1 a::before {
    content: "\2913";   
    font-size: 1.35rem;
    line-height: 1;
    font-weight: 700;
    color: var(--accent-pale);
}

#downloads .vidRes1 a:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
}

.vidContr{
    width:100%; 
    max-width:480px; 
    border-radius:6px; 
}



.download-item {
    margin-top: 14px;
}



.download-all-btn {
    margin-top: 18px;
    padding: 12px 20px;
    width: 100%;

    background: #28a745;
    border: none;

    color: var(--on-accent);
    font-size: 15px;
    font-weight: bold;

    cursor: pointer;
    border-radius: 6px;

    transition: background .15s ease;
}

.download-all-btn:hover {
    background: #218838;
}

.download-all-btn.is-disabled {
    opacity: 0.7;
    cursor: wait;
}



.hidden-download-anchor {
    display: none;
}



#customRes {
    transition: opacity .15s ease;
}



#videoSettingsPanel,
#audioSettingsPanel {
    transition: opacity .15s ease;
}



#flacHint {
    transition: opacity .15s ease;
}



button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}



.fade-panel {
    transition:
        opacity .15s ease,
        transform .15s ease;
}


#bitrateModeGroup {
    margin-top: 12px;
}


#bitrateModeGroup > label {
    display: block;
    margin-bottom: 8px;
}


#bitrateModeGroup .radioGroup {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


#bitrateModeGroup .radioGroup label {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    width: fit-content;
    max-width: 100%;

    cursor: pointer;
    line-height: 1.2;
    margin: 0;
}


#bitrateModeGroup input[type="radio"] {
    margin: 0;
    position: relative;
    top: -1px;
    flex-shrink: 0;
}
.ffmpeg-loading::before {
    content: "Carga del motor (esto puede tardar unos minutos)...";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 9999;
}

#startBtn {
        width: 100%;
}


.msg-box {
    align-items: center;
}

.msg-box input {
    margin-top: 0 !important;
    padding: 6px 8px;   
    height: 32px;
    line-height: 1;
}

.msg-box button {
    margin-top: 0 !important;  
    padding: 6px 10px;         
    font-size: 12px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-lang {
    display: flex;
    align-items: center;
    gap: 10px;
}

 #startBtn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: opacity .2s ease;
    }

#startBtn.loadingBtn {
        pointer-events: none;
        opacity: 0.85;
    }

    
    #startBtn.loadingBtn::after {
        content: "";
        width: 16px;
        height: 16px;
        border: 2px solid rgba(255,255,255,.35);
        border-top-color: #fff;
        border-radius: 50%;
        animation: compressSpin .7s linear infinite;
    }

    
    #startBtn.loadingBtn span {
        opacity: 0.9;
    }

    @keyframes compressSpin {
        to {
            transform: rotate(360deg);
        }
    }

@media (max-width: 500px), (pointer: coarse) {
.footer-grid {
    grid-template-columns: 1fr;
}
}