#emb-viewer-wrapper {
    max-width: 900px;
    margin: 40px auto;
    padding: 24px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#emb-viewer-wrapper h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

#emb-viewer-wrapper .emb-intro {
    margin-top: 0;
    margin-bottom: 20px;
    color: #4b5563;
    font-size: 14px;
}

.emb-upload-block {
    margin-bottom: 16px;
}

.emb-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #111827;
    font-size: 14px;
}

#files {
    display: block;
    width: 100%;
    max-width: 400px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
}

.emb-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.emb-btn {
    border: none;
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.05s ease, box-shadow 0.1s ease, opacity 0.2s;
}

.emb-btn-primary {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

.emb-btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.emb-btn-secondary {
    background: #f3f4f6;
    color: #111827;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

.emb-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

#emb-canvas-wrapper {
    margin-top: 10px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: radial-gradient(circle at top, #f9fafb, #e5e7eb);
    padding: 12px;
    overflow: auto;
}
#emb-canvas-wrapper {
    margin-top: 10px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 12px;
    overflow: hidden; /* quan trọng */
    display: flex;
    justify-content: center;
    align-items: center;
}
#emb-canvas-wrapper {
    width: 100%;
    max-width: 900px;
    height: 600px; /* CHIỀU CAO KHUNG HIỂN THỊ */
    margin: 20px auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #ffffff;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden; /* Không cho tràn */
    position: relative;
}

#theCanvas {
    width: 100% !important;       /* luôn fit với chiều ngang */
    height: 100% !important;      /* luôn fit với chiều cao khung */
    object-fit: contain !important; /* giữ đúng tỉ lệ */
    display: block;

    /* Bắt engine không override CSS */
    max-width: 100% !important;
    max-height: 100% !important;
}


.emb-notes {
    margin-top: 20px;
    font-size: 14px;
    color: #4b5563;
}

.emb-notes h3 {
    margin-top: 16px;
    margin-bottom: 4px;
    font-size: 16px;
    color: #111827;
}
